HTML Content in Custom Fields

Discussion in 'General discussions' started by chris.p, Aug 22, 2019.

  1. chris.p

    chris.p New Member

    Joined:
    Sep 11, 2018
    Messages:
    2
    Likes Received:
    0
    S.E:
    2020-02-21 18:42:57
    L.T:
    Regular
    L.C:
    1
    Hello!

    I thought I had read somewhere that html content was supported in custom fields. Is that not the case? Whether I run an import or try to manually save the field, the html tags get stripped out.

    The field is used to build out a table of varying size, so it would be a pain to try and build into the template itself.

    Perhaps I'm missing something obvious? Any help would be much appreciated.

    Thanks!
     
  2. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,289
    Likes Received:
    2,391
    @chris.p - custom fields are limited to 255 bytes in length, so this means roughly 255 characters at most, which makes them not suitable for storing html. This is also the reason it gets stripped.
    I am sure there are other ways to accomplish what you're after. I assume you need big blobs of html injected in various parts of your template? There is a tag called [REMOTE_CONTENT] which can be used to fetch content from a url, so you could potentially load your html content from remote location. The content is cached and reused, so you won't get any performance issues.
    Code:
    [REMOTE_CONTENT url='https://www.domain.com/some-html-framgment.html']
    
     
  3. chris.p

    chris.p New Member

    Joined:
    Sep 11, 2018
    Messages:
    2
    Likes Received:
    0
    S.E:
    2020-02-21 18:42:57
    L.T:
    Regular
    L.C:
    1
    Ah, ok, that makes sense.

    The html content is unique to each subscriber. It's not huge by any means, but it is over 255 char. In that remote_content tag, can I make that url dynamic? Maybe using a custom field in it? Are there other options?
     
  4. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,289
    Likes Received:
    2,391
    TBH i don't know if custom fields will work in that custom field, you'll have to try and see.
    Other than this, i assume it should be some custom work around the tags parsing, or maybe enable twig and extend it to match your use case.
     
  5. Nick Thacke

    Nick Thacke New Member

    Joined:
    Aug 29, 2019
    Messages:
    4
    Likes Received:
    2
    S.E:
    2020-02-27 13:39:18
    L.T:
    Regular
    L.C:
    1
    How do we change the url inside the [REMOTE_CONTENT=url:....] tag?
     

Share This Page