Skip to content

Instantly share code, notes, and snippets.

@zooks
Last active May 4, 2018 16:23
Show Gist options
  • Save zooks/c8158cb95c118334895cd6f9dd5f730b to your computer and use it in GitHub Desktop.
Save zooks/c8158cb95c118334895cd6f9dd5f730b to your computer and use it in GitHub Desktop.
MODX Fenom MIGX
{set $index = 0}
{set $slider = json_decode($_modx->resource.slider, true)}
{foreach $slider as $row}
<div>
<img src="{$row.image | phpthumbon : 'w=1920&zc=0'}" title="{$row.heading}" alt="{$row.heading}">
<a href="{$row.link}">
{$row.content}
</a>
</div>
{set $index += 1}
{/foreach}
{if $_modx->resource.context_key == 'web'}
{set $rows = [13,14]}
{else}
{set $rows = [46,47]}
{/if}
{foreach $rows as $row}
<div class="col">
<div class="section">
<span></span>
<h3>{$row|resource:'pagetitle'}</h3>
<div class="image">
<a href="{$row|url}">
<img title="{$row|resource:'pagetitle'}" alt="{$row|resource:'pagetitle'}" src="{$row|resource:'image'}">
</a>
</div>
<a class="standalone" href="{$row|url}">Readmore...</a>
</div>
</div>
{/foreach}
<a class="standalone" href="{($_modx->resource.context_key == 'web' ? 16 : 49)|url}">Standalone Link</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment