displaying content without images
7 posts by 5 authors in: Forums > CMS Builder
Last Post: November 29, 2011 (RSS)
<?php if ($record['content']): ?>
<?php echo $record['content'] ?>
<?php endif ?>
Creative Director
JAM Graphics
Re: [jtedescojam] displaying content without images
By Jason - January 12, 2011
You could use the php function strip_tags() to remove all the HTML tags from the content field:
<?php if ($record['content']): ?>
<?php echo strip_tags($record['content']); ?>
<?php endif ?>
Hope this helps.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] displaying content without images
Creative Director
JAM Graphics
Re: [Jason] displaying content without images
By Mikey - November 28, 2011
Hi,
You could use the php function strip_tags() to remove all the HTML tags from the content field:<?php if ($record['content']): ?>
<?php echo strip_tags($record['content']); ?>
<?php endif ?>
Hope this helps.
Jason, is there by chance another way to strip out photos uploaded in the content wysiwyg without stripping out HTML tags? I need to remove photos uploaded to the content, but retain HTML tags in my content for links to other websites, and such.
Thanks, Zick
Re: [zick] displaying content without images
By robin - November 29, 2011
Here is a line with a regular expression that should strip out any img tag:
echo preg_replace("/<img[^>]+\>/i", "", $record['content']);
Hope it helps you out
Robin
Programmer
interactivetools.com
Re: [robin] displaying content without images
By Mikey - November 29, 2011
Zick
Re: [zick] displaying content without images
By InHouse - November 29, 2011
.myArticle img {display: none; visibility: hidden;}
It's belt and braces, but it will work.
J.