Share » Forums » Developer » Problems with <p> tag

Problems with <p> tag

Problems with <p> tag

Friday 16 January 2004 8:19:15 pm - 3 replies

Author Message

Marco Zinn

Saturday 17 January 2004 1:27:19 am

Hi,
well, you intro field is XML, so, depending on the content, you will run into more problems, when some HTML-Structure is not complete after 100 chars.
Option 1: Do not use an XML-Field, but a text field for the intro.
Option 2: Try to get rid of the HTML-Tags before you "shorten" the text. MAYBE the "wash" opertor will do it, but i'm not sure.
Try
{$:item.data_map.resource_introduction.data_text|wash|shorten(100)} and see, what happens. Look at the HTML-source of your page.
Note: If this works, it will remove all HTML-Tags and formatting (such as bold, links, tables).
The other option would be to enhance the "shorten" operator to keep track of open HTML-Tags and close them, before returning the result. But i think, the operator cannot do this and there is no such operator (yet).

Marco
http://www.hyperroad-design.com

Mahesh Arvind

Monday 19 January 2004 1:22:34 am

Hi Macro,

I had tried the wash operator, but it isn't producing the result. It translates the paragraph tags to someting like &gt &lt etc. The <p> tag itself is appearing in the webpage. The thing I needed was to somehow see that </P> doesnt come so that the [More] link doesn't get pushed to the next line. I achieved this by truncating the last four characters of the description which is </p> tag by using string handling functions.

Thanks

Mahesh

Thanks & Regards
Mahesh

Trond Hjelmaas

Monday 11 April 2005 3:36:27 am

Dear Mahesh,

I need to delete the <p> tag as well. If you happen to view this article still, would you mind to post an example of how you use the string function to delete the <p>?

Thanks in advance,
Trond

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu