Hi,

I want to use this code within a page several times with different orientations (image_left/image_right) and different ids:
<div class="image_left">
<r:assets:image id="3" size="normal" />
<h4 class="image_title"><r:assets:title id="3" /></h4>
<div class="image_caption"><r:assets:caption id="3" /></div>
</div>

I tried to be DRY by using the parameterized_snippets extension and put this code into a snippet:

<div class="image_<r:var name="orientation" />">
<r:assets:image id="<r:var name="id" />" size="normal" />
<h4 class="image_title"><r:assets:title id="<r:var name="id" />" /></h4>
<div class="image_caption"><r:assets:caption id="<r:var name="id" />" /></div>
</div>

and call it from the page like:

<r:snippet name="include_image" id="3" orientation="left" />

But this doesn't work. The ID and orientation is resolved correctly. But the r:assets tags are not resolved and appear as plain text in the page.

Is it possible to use the attached assets of a page within a snippet?

If not, is there any other way to avoid repeating the same code several times?

Best Regards
Horst

Reply via email to