I am using Structure (v3.3.8), Assets (v2.0.5), Structure Entries (v1.2.8), and CE Image (v2.4.1). For the major section pages of my site (top-level navigation), I would like to output on the page a section-specific navigation which includes a "page image" (custom field), "page intro", title, and link. Everything is working fine except for the images, and I'm not sure if it's a Structure Entries problem or an Assets problem (or a CE Image problem).
I am trying to do this:
{exp:structure_entries depth="1" parent="{embed:my_parent_id}"}
<div class="column one-third">
<div class="pic">
{page_image}
<a href="{page_uri}">
{exp:ce_img:pair src="{page_image}" width="420" height="279" crop="yes"}
<img src="{made}" alt="{page_image:title}{if
page_image:author} - Photo by {page_image:author}{/if}" />
{/exp:ce_img:pair}
<div class="img_overlay_zoom"></div>
</a>
{/page_image}
</div>
<h3><a href="{page_uri}">{title}</a></h3>
<p>{page_intro}</p>
</div>
{switch='||<div class="clearfix"></div>'}
{/exp:structure_entries}
On the calling page, I have this code:
{embed="embeds/_section_navigation_images" my_parent_id="{structure:page:entry_id}"}
The embed is working fine (the correct section is being displayed), but the images aren't showing up. This is the HTML code that is generated:
<div class="column one-third">
<div class="pic">
{page_image}
<a href="/mysite/index.php/get-involved/donate">
<div class="img_overlay_zoom"></div>
</a>
{/page_image}
</div>
<h3><a href="/mysite/index.php/get-involved/donate">Donate</a></h3>
<p>Donate to our organization and help ...</p>
</div>
...
The {page_image}
tags are not being parsed, and the image isn't being output at all.
Debugger Output (Excerpt)
(26.607746 / 30.22MB) Tag: {exp:structure_entries depth="1" parent="65"}
(26.608122 / 30.22MB) Closing Tag Found
(26.608356 / 30.22MB) Processing Tags
(26.608584 / 30.22MB) Plugin Tag: Structure_entries/
(26.608702 / 30.22MB) Including Files for Plugins and Modules
(26.608801 / 30.22MB) Files for Plugins and Modules All Included
(26.608893 / 30.22MB) Beginning Final Tag Data Processing
(26.609005 / 30.22MB) Calling Class/Method: Structure_entries/
(26.609129 / 30.22MB) Nested Plugins in Tag, Parsing Outward First
(26.609618 / 30.24MB) Tag: {exp:ce_img:pair src="{page_image}" width="420" height="279" crop="yes" filter="auto_sharpen"}
(26.610344 / 30.24MB) Closing Tag Found
(26.610655 / 30.24MB) Plugin Tag: Ce_img/pair
(26.610761 / 30.24MB) Including Files for Plugins and Modules
(26.610847 / 30.24MB) Files for Plugins and Modules All Included
(26.610974 / 30.24MB) Beginning Final Tag Data Processing
(26.611076 / 30.24MB) Calling Class/Method: Ce_img/pair
(26.611854 / 30.24MB) -> Class Called: Ce_img
(26.612009 / 30.25MB) -> Method Called: pair
(26.621115 / 30.26MB) *** CE Image debug: Base path: 'C:/Users/Amy/Dropbox/www/'
(26.621214 / 30.26MB) *** CE Image debug: Source image: '{page_image}', Fallback image: ''
(26.621292 / 30.26MB) *** CE Image debug: Source image is not readable or does not exist: '{page_image}'.
(26.621367 / 30.26MB) *** CE Image debug: Fallback source image is not readable or does not exist: ''.
(26.621515 / 30.27MB) Returning No Results Content
(26.621909 / 30.25MB) -> Data Returned
(26.623894 / 30.23MB) -> Class Called: Structure_entries
(26.909353 / 30.25MB) structure_entries: Starting main loop through entries. Total rows from DB=32
(27.371411 / 30.31MB) structure_entries: tagdata= <div class="column one-third"> <div class="pic"> {page_image} <a href="{page_uri}"> <div class="img_overlay_zoom"></div> </a> {/page_image} </div> <h3><a href="{page_uri}">{title}</a></h3> <p>{page_intro}</p> </div> {switch='||<div class="clearfix"></div>'}
(27.371651 / 30.31MB) structure_entries: ID=72 url=/ee-mjv/index.php/get-involved/donate
(27.377516 / 30.32MB) structure_entries: tagdata= <div class="column one-third"> <div class="pic"> {page_image} <a href="{page_uri}"> <div class="img_overlay_zoom"></div> </a> {/page_image} </div> <h3><a href="{page_uri}">{title}</a></h3> <p>{page_intro}</p> </div> {switch='||<div class="clearfix"></div>'}
When I strip off the CE Image tags and just output the {page_image}
it gives the filename. If I change it to {page_image:url}
, it does not parse at all.
Updated Code
I'm updating my code based on @Aaron's comments:
{exp:structure_entries depth="1" parent="{embed:my_parent_id}" parse="inward"}
<div class="column one-third">
<div class="pic">
{page_image}
<a href="{page_uri}">
{exp:ce_img:pair src="{url}" width="420" height="279" crop="yes" filter="auto_sharpen"}<img src="{made}" alt="{title}{if author} - Photo by {author}{/if}" />{/exp:ce_img:pair}
<div class="img_overlay_zoom"></div>
</a>
{/page_image}
</div>
<h3><a href="{page_uri}">{title}</a></h3>
<p>{page_intro}</p>
</div>
{switch='||<div class="clearfix"></div>'}
{/exp:structure_entries}
The Assets field (page_image) is still not being treated like a tag pair as it should.
I appreciate any help you can offer! Thanks.