Jump to content

Render HTML in field descriptions?


alan
 Share

Recommended Posts

Would it be easy to allow HTML into field descriptions to be rendered? Right now a link tag for example is sanitized down to it's component characters.

Why would I want to do this? I think I can see times when I might want to educate the content editor on what they should type in a field, such as a field used to populate meta description, and the ability to include a link to a help article would be cool.

Link to comment
Share on other sites

No I don't think so but thanks for the suggestion — the place I'm looking to have HTML rendered is

Admin > Setup > Fields > Edit field: whateverField

and then the

Description text

so that when the field is saved and it's description (not its input field) is viewed in a template, the Description text can include rendered HTML such as a link.

Link to comment
Share on other sites

alan, you can use markdown or textile syntax in description fields. http://en.wikipedia.org/wiki/Markdown

This was mentioned here: http://processwire.c...__fromsearch__1

Markdown is a module in PW by default (textformatter), textile version is also existent.

you can, using markdown, simply do this to make links in field description :

[linktext](someurl)

O0

***

corrected some

  • Like 3
Link to comment
Share on other sites

Steve, that's not it. This is only for text field output.

This is about the field description text, that's shown in the fieldset of the field when editing.

Alan, I don't know really, I think Ryan knows better. I was also looking if there's a "field" setting that you could chose which textformatter, but no luck.

Link to comment
Share on other sites

Thanks @Steve and @Soma. OK, I understand, markdown is 'hard-coded' in as a supported way to add links and that is AOK by me.

I was really only looking for the ability to add links rather than other markup and although I know Textile and not markdown, learning the syntax for links in markdown is something even I can do ;)

Link to comment
Share on other sites

  • 10 months later...

I've noticed that when adding a markdown style of link in notes or description by default a target="_blank" is added. Is there any way to circumvent adding the target="_blank" tag?

For now I've added some jQuery to remove the attribute, but it would be nice to have an option whether to use target="_blank" or not.

$(function(){
        $(".Inputfield_yourname .notes a").removeAttr("target");
});
Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...