You are viewing the PKP Support Forum | PKP Home Wiki

new line to break (nl2br)

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

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

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

new line to break (nl2br)

Postby lawrence » Mon Jan 16, 2006 7:00 pm

Hi there,

When I add abstract of an article to OJS thru "Edit Metadata",
it automatically adds <br /> to the abstract if the abstract has a new line,
is there a way to disable it.

The reason being that I will add some html tags in the abstract to control the style and layout, the automatical injection of <br /> make me very difficult to control the style and layout.

Posts: 10
Joined: Mon Dec 19, 2005 11:00 am
Location: Edmonton, Canada

Postby asmecher » Tue Jan 17, 2006 2:45 pm

Hi Lawrence,

The BRs are applied when the Abstract field is displayed -- they aren't actually stored in the database. To prevent this coversion from taking place, look through the template files (*.tpl) for getArticleAbstract, removing the nl2br call. For example, change:
Code: Select all
Code: Select all

To edit all files where this occurs, I use the following command line in Linux: (note the backticks)
Code: Select all
vi `fgrep -l getArticleAbstract \`find . -name \*.tpl\``
Alec Smecher
Open Journal Systems Team
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Return to OJS Technical Support

Who is online

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