CMS BUILDER..

12 posts by 3 authors in: Forums > CMS Builder
Last Post: March 20, 2009   (RSS)

Re: [weblinks] CMS BUILDER..

By ross - March 20, 2009

Hi Bob

I actually meant to say swap the <p> for <br> instead of completely removing them.

On your template, you'll likely have something like this:

<?php echo $record['title']' ?>

or something like that for each field you are displaying. To replace the <p> tags, try this code:

<?php $record['content'] = preg_replace("/<p>/i", "<br>", $record['content'] ); ?>
<?php $record['content'] = preg_replace("/<\/p>/i", "", $record['content'] ); ?>
<span><?php echo $record['content']; ?></span>


You'll need to use all three lines for each field you want to swap the tags in. You can add a class attribute to the final span tag if you wanted additional styles.

Give this a shot and let me know how you make out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/