Below is the div. On the resource I have a TV to insert an image. The div is styles with css with borders and such.
What I would like to do is change the css to display:none if no image inserted. Any ideas would be great. I tried using javascript but could not get it to work.
<div class="image">
<img src="[*blogimage*]" width="240"/>
<br />
<p>[*imagedescription*]</p>
</div>
Everything I know I learned on the internet. Saved me thousands in College tuition,
You need to use PHx -
http://wiki.modxcms.com/index.php/PHx#Introduction
.hideDiv {
display:none
}
<div class="image [*blogimage:eq=``:then=`hideDiv`*]">
<img src="[*blogimage*]" width="240"/>
<br />
<p>[*imagedescription*]</p>
</div>
You could also not output the div at all and put your div into a chunk called
imageDivChunk.
[*blogimage:ne=``:then=`{{imageDivChunk}}`*]
DropboxUploader -- Upload files to a Dropbox account.
DIG -- Dynamic Image Generator
gus -- Google URL Shortener
makeQR -- Uses google chart api to make QR codes.
MODxTweeter -- Update your twitter status on publish.
Thanks that worked perfect.
Although after reading the wiki I changed the ne to is so that if the image TV is "" then hide div. I’ll read more on this PHx. Is it available for the new revolution?
Everything I know I learned on the internet. Saved me thousands in College tuition,
-
☆ A M B ☆
- 24,524 Posts