#1 August 4, 2022 9:32am

mke18
Member
Registered: April 18, 2018
Posts: 28

Footer text/credit description

Hello!

I'm having issues with a footer credit description from text into HTML. Currently the site has the footer description as Text Area type and I created a new feature with a HTML Area field type. However, the Html type is not appearing within the paragraph tag with the .credit class and it adds extra paragraph tags. Please see the attached screenshot: https://imgur.com/a/P5JHj51.

Would anyone help or suggest how to fix the problem?

Thanks,

Offline

#2 August 4, 2022 8:06pm

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 974

Re: Footer text/credit description

So if you’re outputting the Simple (or non-simple) HTML field into a <p> tag it’s going to have a nested <p> which is going to cause issues for you. If you want to allow certain tags but not others you could use strip_tags on the value. An example that only allows links, bold, and italic:

<p class=“credit”><?=strip_tags($value, “<em><strong><a>”)?></p>

Note that the code above is getting fancy quotes because I’m on my iPad and it’s being silly. You obviously wouldn’t use fancy quotes in the code smile

Offline

#3 August 8, 2022 7:16pm

mke18
Member
Registered: April 18, 2018
Posts: 28

Re: Footer text/credit description

Thanks for the help!

Offline

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.