OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Strip HTML tags in RSS feed title

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

Strip HTML tags in RSS feed title

Postby aleskl » Fri Sep 21, 2012 6:40 am

Hello,

is is possible to completely remove HTML tags from RSS feed title, eg. in the template atom.tpl, the title generating line is this:
Code: Select all
<title>{$journal->getLocalizedTitle()|escape:"html"|strip} {$issue->getIssueIdentification()|escape:"html"|strip}</title>

However, the title that is generated contains HTML codes, and that is not nice to RSS feed readers.

Google Reader displays the following for our RSS feed title:
Description: <p><span><span><span lang="EN-GB"><img style="float: right; padding-left: 10px;" title="Image Analysis &amp; Stereology cover" ...


The link to the RSS feed is http://www.ias-iss.org/ojs/IAS/gateway/ ... lugin/atom

So, I would like to know if the HTML purifier has any more rigorous switches to clean text?

With kind regards,
Ales
aleskl
 
Posts: 96
Joined: Mon Apr 11, 2011 7:08 am

Re: Strip HTML tags in RSS feed title

Postby asmecher » Fri Sep 21, 2012 8:16 am

Hi Ales,

I believe strip_tags is what you're looking for, no?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8591
Joined: Wed Aug 10, 2005 12:56 pm

Re: Strip HTML tags in RSS feed title

Postby aleskl » Mon Sep 24, 2012 4:04 am

Thanks, that was exactly what I needed. Actually, the problem was the <subtitle> tag in the Atom feed. I used then this in the atom.tpl:
Code: Select all
<subtitle>{$description|strip_tags|trim}</subtitle>

However, the generated tag still contains some multiple spaces. I tried to use preg_replace or regex_replace at the end, but it didn't work. But I'm quite happy with the html tags stripped away.

Cheers, Ales
aleskl
 
Posts: 96
Joined: Mon Apr 11, 2011 7:08 am

Re: Strip HTML tags in RSS feed title

Postby asmecher » Tue Sep 25, 2012 9:09 am

Hi Ales,

Thanks; I've filed this at http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=7935 for a closer look.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8591
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Development

Who is online

Users browsing this forum: Bing [Bot] and 1 guest