0

I'm trying to output a custom field of the author of an entry. And no matter what I do, it wraps it in an <a> tag that I cannot do anything with. I just want to output that value, but ExpressionEngine keeps wrapping it.

All I do is this:

{exp:channel:entries channel="mychannel"}
    {custom_field}
{/exp:channel:entries}

And what comes out is this:

<a href="whatever is in this field">whatever is in this field</a>

And if I try to wrap it in an a tag myself, it wraps double.

<a href="<a href="whatever is in this field"></a>">Link here</a>

Do I really need to strip the output manually with either PHP or Javascript?

1 Answer 1

1

This sounds like the "auto hyperlink" feature built into each of the Channel preferences. This custom field doesn't happen to be a hyperlink or email address by chance?

If it is, simply disable this feature on a per channel basis by:

  1. going to Admin > Channels > Edit Preferences (for whatever channel you want to edit),
  2. Scroll down and set "Automatically turn URLs and email addresses into links" to NO.

--

You can also explore whether the custom field has a certain Default Text Formatting setting that's causing it to format differently on publish.

  1. Admin > Channel Fields
  2. Click into a Group
  3. Edit the field settings
  4. Set Default Text Formatting to no

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.