I have a channel entry for houses in which the user can enter all the details for a house (I simplified the fields for this). For the home page, I am pulling a list of "model homes" that are a multiple relationship field and stashing them for displaying in my template. So I am inside my channel_entries loop for the home page and down a bit in my stash template. Here is my stash segment for this:
My relationship field in the home page is Relationship Field = {model_homes}
{exp:stash:set_list name="sv_model_homes" parse_tags="yes"}
{model_homes}
{stash:sv_house_url}{model_homes:url_title}{/stash:sv_house_url}
{stash:sv_overview}{model_homes:overview}{/stash:sv_overview}
{exp:stash:set_list name="sv_address" parse_tags="yes"}
{model_homes:address}
{stash:sv_street}{address:street}{/stash:sv_street}
{stash:sv_city}{address:city}{/stash:sv_city}
{stash:sv_state}{address:state}{/stash:sv_state}
{stash:sv_zip}{address:zip}{/stash:sv_zip}
{/model_homes:address}
{/exp:stash:set_list}
{exp:stash:set_list name="sv_house_images" parse_tags="yes"}
{model_homes:house_images cover_only="yes"}
{stash:sv_house_image_full}{image:url{/stash:sv_house_image_full}
{stash:sv_house_image}{image:url:gallery}{/stash:sv_house_image}
{stash:sv_house_title}{image:title}{/stash:sv_house_title}
{/model_homes:house_images}
{/exp:stash:set_list}
{exp:stash:set_list name="sv_details" parse_tags="yes"}
{model_homes:house_details}
{stash:sv_price}{house_details:price}{/stash:sv_price}
{stash:sv_bedrooms}{house_details:bedrooms}{/stash:sv_bedrooms}
{stash:sv_bathrooms}{house_details:bathrooms}{/stash:sv_bathrooms}
{stash:sv_living_rooms}{house_details:living_rooms}{/stash:sv_living_rooms}
{stash:sv_dining_rooms}{house_details:dining_rooms}{/stash:sv_dining_rooms}
{stash:sv_square_footage}{house_details:square_footage}{/stash:sv_square_footage}
{/model_homes:house_details}
{/exp:stash:set_list}
{/model_homes}
{/exp:stash:set_list}
Inside the houses channel fields are the following grid
and channel_images
fields.
INSIDE the homes entry are the following fields giving me trouble:
GRID - {address}
CHANNEL IMAGES - {house_images}
GRID - {house_details}
This is my {content_home}
template (display) for this content segment:
<ul class="slides">
<li>
<div class="row">
{exp:stash:get_list name='sv_model_homes'}
<div class="col-md-4 col-sm-6">
<div class="thumbnail boxed">
<div class="listing-image">
<span class="listing-tag important">Model Home</span>
{exp:stash:get_list:nested name='sv_house_images'}
<img src="{sv_house_image}" alt="{sv_house_title}">
<div class="image-links">
<div class="left">
<a class="inner" href="{sv_house_image_full}" data-lightbox="related-1">
<i class="fa fa-camera"></i>
</a>
</div>
<div class="right">
<a class="inner" href="{site_url}house/{sv_house_url}">
<i class="fa fa-link"></i>
</a>
</div>
</div>
{/exp:stash:get_list:nested}
{exp:stash:get_list:nested name='sv_details'}
<div class="image-tags">
<ul class="property-tags">
<li><span><i class="icon-bed"></i> {sv_bedrooms}<br><span class="small">Bedrooms</span></span></li>
<li><span><i class="icon-shower"></i> {sv_bathrooms}<br><span class="small">Bathrooms</span></span></li>
</ul>
</div>
{/exp:stash:get_list:nested}
</div>
<div class="description">
{exp:stash:get_list:nested name='sv_address'}
<h4>{sv_street}<br><small>{sv_city}, {sv_state}</small></h4>
{/exp:stash:get_list:nested}
{exp:stash:get_list:nested name='sv_details'}
<div class="row">
<div class="col-xs-6">
<strong>Property Size:</strong>
</div>
<div class="col-xs-6">
{sv_square_footage} SqFt
</div>
<div class="col-xs-6">
<strong>Rooms:</strong>
</div>
<div class="col-xs-6">
{sv_bedrooms} Bed, {sv_bathrooms} Bath
</div>
</div>
<hr>
<span class="price-tag">
${sv_price}
</span>
{/exp:stash:get_list:nested}
<a href="{site_url}house/{sv_house_url}" class="btn btn-link " role="button">+ Show Details</a>
</div>
</div>
</div>
{/exp:stash:get_list}
</div>
</li>
</ul>
The problem is that I AM getting information, just not the correct information.
If I test the loop like this:
<div class="row">
{exp:stash:get_list name='sv_model_homes'}
{sv_house_url} - {count}<br>
{/exp:stash:get_list}
</div>
I get the proper {sv_house_url}
and {count}
. It loops through the trhee tests and count 1, 2, 3.
However, in my markup for {content_home}
, (above), I just get the first entry. I've tried using the prefix=''
tag, but that didn't change anything for me. (I could have been using it incorrectly too though.)
What do I need to do in order to get the proper data from my stash set_list?