Hello everybody,
I'm trying to find out how to make something conditional. (Let me explain this a little deeper)
I have a TV setup for inserting up to 5 images for a slideshow.
However, I would like to have the option of using less than all 5 images if possible.
Here is my HTML code being used.
<section class="slideshow">
<ul class="slides">
<li><img alt="[[*SlideOneTitle]]" src="[[*SlideOneSrc]]"></li>
<li><img alt="[[*SlideTwoTitle]]" src="[[*SlideTwoSrc]]"></li>
<li><img alt="[[*SlideThreeTitle]]" src="[[*SlideThreeSrc]]"></li>
<li><img alt="[[*SlideFourTitle]]" src="[[*SlideFourSrc]]"></li>
<li><img alt="[[*SlideFiveTitle]]" src="[[*SlideFiveSrc]]"></li>
</ul>
</section>
If I only use 1 image, I will be stuck with 4 blank <li> tags in my page. How can I make it conditional based on the number of src=" " added?
This is probably something basic but as of right now, I am only about a week into use MODX Revolution. My work-around currently consists of 5 chunks:
- [[$Image]] (I use this because obviously, 1 image is not a slideshow)
- [[$Gallery2]]
- [[$Gallery3]]
- [[$Gallery4]]
- [[$Gallery5]]
Each chunk has only the specific HTML code to satisfy the number of uploaded images but that is my rookie way of making this work. A single image wouldn't really need the <ul> and <li> tags.
It would be nice if there was a way to solve this using a conditional. I'm not a programmer so...
Of course any help would be greatly appreciated!
[ed. note: adagency last edited this post 13 years, 7 months ago.]