Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-02-22 19:54:00

Transmodiar
Member
Registered: 2007-02-22
Posts: 17

Appending text before article body

I’m using TextPattern to create a press release page for my site. Rather than code the location and date to the beginning of the press release, I thought I’d use the template to display that information for me. However, the end result looks something like this…

SAN DIMAS, Calif. (April 28, 1998) –

Bill and Ted, managers of Pretzels and Cheese

… with the carriage returns between the en-dash and the release. Is there a way to remove that? In the article itself, I’ve removed the tags around the first paragraph but they keep being reinserted when the page is published.

Thanks for your help. If you’d also be willing to help a newcomer with showing him how to do a quick “Recent Articles” bullet list beneath the release, that would also be great!

Matt

Offline

#2 2007-02-22 21:24:12

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Appending text before article body

Textile wraps the article body (or rather the paragraphs in the body) in <p> tags. You can turn Textile off, sitewide in Admin > Preferences, or on a per article basis under Advanced options in the Write screen. Or, if you want to keep Textile but don’t want the paragraphs, begin your paragraph with a space.

txp:recent_articles

Offline

#3 2007-02-22 21:31:59

Transmodiar
Member
Registered: 2007-02-22
Posts: 17

Re: Appending text before article body

Els wrote:
You can turn Textile off, sitewide in Admin > Preferences, or on a per article basis under Advanced options in the Write screen.

I have Textile set to leave text untouched, and the Advanced Settings on each article are set to the same. Still shows up with P tags wrapped around it. Any other places to click/unclick?

Thanks,
Matt

Offline

#4 2007-02-22 21:45:33

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Appending text before article body

If you don’t mind some messy code, instead of <txp:body /> you could try something like this, although you’d have to add a <p> tag yourself to keep the XHTML valid:

<txp:php>echo preg_replace('^<p>', '', body(array()) );</txp:php>

Offline

#5 2007-02-22 23:56:57

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Appending text before article body

Transmodiar wrote:

I have Textile set to leave text untouched, and the Advanced Settings on each article are set to the same. Still shows up with P tags wrapped around it. Any other places to click/unclick?

Did you change these settings after you saved the article? If so, try if re-saving makes a difference.

Last edited by els (2007-02-22 23:57:11)

Offline

#6 2007-02-23 00:03:01

Transmodiar
Member
Registered: 2007-02-22
Posts: 17

Re: Appending text before article body

Els wrote:

Did you change these settings after you saved the article? If so, try if re-saving makes a difference.

That did the trick. Thanks!

Offline

Board footer

Powered by FluxBB