Support

Account

Home Forums Bug Reports HTML Characters in Field Instructions

Solving

HTML Characters in Field Instructions

  • So I’m trying to create instructions on a textarea that lets folks know about available HTML tags. The goal is to have it display like this:

    Available HTML tags include: <small>, <strong>

    Now, as expected, when I enter the above into the field instructions, it renders it as HTML.

    So, to work around that, I attempted the following:

    Available HTML tags include: <small>, <strong>

    That works on the initial save. When editing the field again, though, < is rendered as < and, on saving, it disappears again.

    I’m not sure if this is a bug, a feature request, or me just missing the right way to do something so please direct me accordingly.

    Update: In the second example above I am attempting to use the HTML character entity name. < should be & lt ; (with the spaces removed), etc..

  • Hi @sirjonathan

    Thanks for the feedback. I’ll do some testing and let you know what I find.

    Thanks
    E

  • Hi @sirjonathan

    I just created a new field and entered this as the instructions:
    available tags are <small>

    The tags appeared correctly above the field, and on another save of the field group, the instructions continue to appear correctly…

    May I ask what version of ACF are you using?

  • Looks like theres still some inconsistency in this. Using ACF 4.4.2.

    Field instructions require using entity codes to display HTML tags as text. This is fine by me. But in repeater sub-fields, the entity codes are saved as HTML and cannot be displayed in the instructions.

  • I discovered a real easy fix to this:

    In the field instructions, instead of using an open-tag use the HTML code for the open-tag and then it shouldn’t be parsed as code.

    So instead of < You could use &lt;

    e.g.

    available tags are &lt;small>

    This worked for me when adding the br code for line-breaks.

    Apologies if you got loads of comment notifications for this reply – it took me a while to post this solution, since the comments box and code tags parse the characters and kept making lots of < characters instead of what i was trying to show you! πŸ˜€

  • OK actually – I just re-read your original post, and realise I’ve told you to do what you were doing in the first place. SORRY!!!

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘HTML Characters in Field Instructions’ is closed to new replies.