Created
October 27, 2013 21:55
-
-
Save jeremyworboys/7188336 to your computer and use it in GitHub Desktop.
Separation of concerns with MVVM EE Stash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{!-- model.html --} | |
{exp:channel:entries | |
channel="work" | |
url_title="{stash:url_title}" | |
require_entry="yes" | |
{global:disable} | |
} | |
{exp:stash:set_list name="images"} | |
{post_carousel_images} | |
{stash:url}{url}{/stash:url} | |
{stash:alt_text}{alt_text}{/stash:alt_text} | |
{stash:width}{width}{/stash:width} | |
{stash:height}{height}{/stash:height} | |
{/post_carousel_images} | |
{/exp:stash:set_list} | |
{/exp:channel:entries} | |
{!-- view.html --} | |
<div class="rotator big"> | |
<div id="rotator" class="slides"> | |
{exp:stash:get_list name="images"} | |
<div class="slide"> | |
<img src="{url}" alt="{alt_text}" width="{width}" height="{height}"> | |
</div> | |
{/exp:stash:get_list} | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{!-- model.html --} | |
{exp:channel:entries | |
channel="work" | |
url_title="{stash:url_title}" | |
require_entry="yes" | |
{global:disable} | |
} | |
{exp:stash:set_list name="images"} | |
{post_carousel_images} | |
{stash:image}<img src="{url}" alt="{alt_text}" width="{width}" height="{height}">{/stash:image} | |
{/post_carousel_images} | |
{/exp:stash:set_list} | |
{/exp:channel:entries} | |
{!-- view.html --} | |
<div class="rotator big"> | |
<div id="rotator" class="slides"> | |
{exp:stash:get_list name="images"} | |
<div class="slide"> | |
{image} | |
</div> | |
{/exp:stash:get_list} | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment