Search
Other Articles Anywhere questions
Forum

Nested articles with custom field created excess <p> <span class="field-value".​. code

Rachel Walraven's Avatar Rachel Walraven
Here I am again..

I have an article with custom articleslinked field. Below the article those articles are displayed in a module.

It works, but I get an extra paragraph with a span:
<p>
<span class="field-value">
</span>
</p>

The module code is very simple:
{article}
<div class="grid">
[fieldname]
</div>
{/artilcle}

The custom field as a custom html value to show the linked items:
<div class="events">
{article-others [id]}
<div class="datum"><h3><strong>[link][title][/link]</strong></h3>{if datum}<p><i class="far fa-calendar-alt"></i> [datum]</p>{/if}</div>{if image-intro}<div class="image"><p>[image-intro]</p></div>{/if}
<div class="tekst"><p>[introtext]</p></div>
<div class="link"><p>[link class="button"]Meer info[/link]</p></div>
{/article-others}
</div>

How can I get rid of the extra paragraph with the span?

Greetings,
Rachel
Andrea Malalana's Avatar Andrea Malalana ADMIN
The extra paragraph depends on your editor. To avoid it, make sure you put [fieldname] in the same line as the parent div.

The span is due to the field being rendered through the layout. To avoid that, simply do [fieldname layout="false"].
Rachel Walraven's Avatar Rachel Walraven
If I do that, the paragraph is gone, but now all my items are insde the <span class="field-value">. I can make that work, but prefer not to have those either.
Andrea Malalana's Avatar Andrea Malalana ADMIN
See the second part of my message 😁
Rachel Walraven's Avatar Rachel Walraven
Sorry, overlooked that completely.

Thank you!
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription