In my content template I have two fields (date and teaser) and I want to show them like this:
29-03-2008 - Here goes the text of the teaser
So far, I haven't been able to do this. I get a line break between the two elements. When I look in the source code of the generated page, I see the second element (the teaser) has
around it. Does anyone know if/how I can get my teaser the way I described above?
Comments
Comment #1
jrglasgow commentedthe line break is actually html paragraph tags
there are two ways to do this
This will replace the beginning(
<p>) and ending(</p>) paragraph tags and replaces them with an empty string('').The strip_tags() function removes html tags from the string, take a look at the php.net manual page, you can have it strip some tags but leave some alone.
Comment #2
bergco commentedThanks! Somehow I got an error message, but with your hints I constructed this:
print format_date($node->created,'custom','d-m-Y')-print strip_tags($node->teaser)and it works fine! Thanks again. Still got a lot to learn...
Comment #3
jrglasgow commented