<div id="slider" class="nivoSlider">
                             {exp:channel:entries channel="properties" dynamic="no" limit="10" disable="categories|member_data|category_fields|member_data|pagination"} 
                          Start matrix- {property_photos limit="1" sort="asc"}    
                            Photo frame- {photo_images size="slider"}       
                                <a href="{title_permalink="/properties/view"}"><1mg src="{photo:url}" alt="" title="#htmlcaption" /></a> 
                            {/photo_images} {/property_photos} - close matrix

                        <div id="htmlcaption" class="nivo-html-caption">
     <strong>{property_address}</strong><span>{rooms} rooms,{bathrooms} Baths,{beds} beds, House size:{house_size} sq.ft., Price $ {price} <a href="#"> View Property</a></span>
                     </div>{/exp:channel:entries} </div></div>

Could anyone give me some advice on how to improve this? When validating html, it warns that's the html caption div is repeated twice. Is there anyway to slim this down ?


I'm not sure how you've implemented that or what else is surrounding it but if you had 10 entries, you'd repeat the div 10 times - if you're getting this error repeating twice - you have 2 entries.

If that is expected behavior then I'd imagine the issue is that because you're calling id='htmlcaption' and ID's MUST be unique - you simply need to append the entry ID so that it's unique

<div id="htmlcaption-{entry_id}" class="nivo-html-caption">

If you require that div only once then you should use the simple conditional…

{if count==1}
  <div id="htmlcaption" class="nivo-html-caption">...stuff here</div>

If you need that div at the very end, use this instead:

{if count == '{absolute_results}'}
 <div id="htmlcaption" class="nivo-html-caption">...stuff here</div>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.