Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-06-28 18:12:11

sevasjack
New Member
Registered: 2017-06-28
Posts: 2

How to remove txp tags from Body_html

Hello!
I need to export posts in custom rss and when I just export Body_html field from database it’s contain txp tags like txp:permlink, txp:image and others. How can I make a valid rss and automatically change txp:tags to html tags?

Thanks in advace.

Offline

#2 2017-06-28 19:33:09

etc
Developer
Registered: 2010-11-11
Posts: 5,087
Website GitHub

Re: How to remove txp tags from Body_html

Hello, welcome to the forum!

If you are constructing the feed in pure php, you need to parse the content:

echo parse('...retrieved Body_html content...');

However, this won’t correctly process all txp tags (like <txp:permlink />), because Body_html does not contain the necessary data (article ID and so on). A tentatively better way is

echo parse('<txp:article id="13"><txp:body /></txp:article>');

But I’m pretty sure you can export it via txp itself, with a plugin like rah_external_output. Don’t hesitate to ask for help if needed.

Offline

#3 2017-06-29 08:34:10

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,032
Website GitHub Mastodon Twitter

Re: How to remove txp tags from Body_html

+1 for rah_external_output. It’s easy to use and gives you the flexibility you need. Check out the forum thread for more info.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2017-06-29 13:51:59

sevasjack
New Member
Registered: 2017-06-28
Posts: 2

Re: How to remove txp tags from Body_html

etc, colak, thanks a lot!
rah_external_output – good solution for me.

Offline

Board footer

Powered by FluxBB