#1 2016-03-20 15:07:39

federico
Member
Registered: 2016-01-25
Posts: 12

How to get rid of the default <p> tag on article content

Simple question: Do you know how to get rid of the <p> tag automatically generated by Ionize to display articles's content?

Here a simple code snipped:

<ion:page:articles>
   <ion:article>
      <ion:content/>
    </ion:article>
</ion:page:articles>

the <ion:content /> generates html within the <p> ..article content... </p> tags, but no way to discard these tags.

Anyone?
thank you in advance
best,
f

Offline

#2 2016-03-23 19:20:29

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: How to get rid of the default <p> tag on article content

Hello,

I think the default <p> tag is added by the TinyMCE, you can write something similar than the strip_tags helper: http://ionizecms.com/forum/viewtopic.php?id=2220

Best Regards,
Adamos42


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#3 2016-04-18 01:19:42

federico
Member
Registered: 2016-01-25
Posts: 12

Re: How to get rid of the default <p> tag on article content

Hi Adamos,
thank you for your reply. I will post here the solution once I will try and check the suggested code.
Best,
fm

Offline

#4 2016-04-19 11:14:16

dh-webservice.eu
Member
From: Merano, Italy
Registered: 2015-10-14
Posts: 51
Website

Re: How to get rid of the default <p> tag on article content

I usually use this PHP-Snippet, it works very well ;-)

<?= substr(substr('<ion:content />', 3),0,-4); ?>


Ionize Fan from Northern Italy ;-)

Offline

#5 2016-05-27 21:28:43

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: How to get rid of the default <p> tag on article content

dh-webservice.eu wrote:

I usually use this PHP-Snippet, it works very well ;-)

<?= substr(substr('<ion:content />', 3),0,-4); ?>

A preg_replace will be faster and that not will leave a </p> in the source.


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

What's Ionize ?

Ionize is an Open Source Content Management System created by webdesigners for webdesigners.

Created and maintained by Partikule and Toopixel, Ionize wants to be the easiest and most powerful CMS.

Can I help ?

Because talent is nothing without involvement, we are looking for motivated coders and webdesigners to join the project team.

Resources

Website : ionizecms.com
Documentation : doc.ionizecms.com

Development : Ionize on GitHub
Translations : Ionize Translations