0

I created a channel "project" with several channel fields. For my question I am using the example of a field called "White Header", the short name is white_header and is is of Type Text Input.

When I output the field in my template, the content of the field of an entry is surrounded by

elements, which I don't need.

{exp:channel:entries channel="projekt" limit="1" orderby="date" sort="desc"}
    <h2 class="content__header">{white_header}</h2>
{/exp:channel:entries}

The resulting HTML is:

<h2 class="content__header"><p>White Header Content</p></h2>

I would like the HTML to be:

<h2 class="content__header">White Header Content</h2>

What I tried:

  • I changed the default text formatting from Markdown to None, but it didn't change anything
  • Tried to find a solution in the documentation
  • Tried to find a solution with google, but did only find an entry about "grid" (what is grid?) that didn't help in my situation.

How can I avoid, that ExpressionEngine outputs HTML elements, that I do not need?

What would alternatively help: Is there a way to assign a class to the auto generated <p> element?

2
  • 1
    Did you make sure to check Update all existing channel entries with your new formatting choice? when you changed the Default Text Formatting for your fields? – jrothafer Oct 28 '15 at 13:09
  • Oh, it seems, that I didn't do that. It helps actually! Thanks. Is there a way to allow markdown without paragraphs? – Rias Oct 28 '15 at 13:14
1

It sounds like you would do best to make use of a WYSIWYG Field Type addon. There are several. I think the ones that get the most use are Wygwam, Expresso, and Wyvern.

https://devot-ee.com/add-ons/wygwam

https://devot-ee.com/add-ons/expresso

https://devot-ee.com/add-ons/wyvern

They are all built on top of CKEditor. This field will allow content editors more freedom to build content, and also allow for markdown editing without any forced tags. They also allow for customization of the field type. Try out CKEditor to get a feel for the field. They will auto-add <p> tags when in editor mode, but that is generally customizable, and you can use the source mode to edit the HTML markdown however you'd like.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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