Skip to content

Instantly share code, notes, and snippets.

@since1976
Created April 5, 2011 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save since1976/c657a378ab7477dcfa12 to your computer and use it in GitHub Desktop.
Save since1976/c657a378ab7477dcfa12 to your computer and use it in GitHub Desktop.
EE Template Code that I'm using to pull out the gallery images if there is more than one.
<div id="cakePhoto" class="grid_8 last">
{if "{cf_cake_photos:total_rows search:mtx_enable_photo="y"}" == "1"}
<div id="gallery" class="solo">
{cf_cake_photos orderby="mtx_cake_photo_type" sort="asc" search:mtx_enable_photo="y"}
{if mtx_flickr}
{exp:ce_img:single
src="{mtx_flickr size="large"}"
attributes='alt="{mtx_cake_photo_description}" title="{mtx_cake_photo_title}"'
debug="yes"
crop="no"
max_height="640"
max_width="600"
smart_scale="yes"
}
{if:else}
{exp:ce_img:single
src="{mtx_cake_image}"
crop="no"
max_height="640"
max_width="600"
smart_scale="yes"
attributes='alt="{mtx_cake_photo_description}" title="View {mtx_cake_photo_title}"'
debug="yes"
}
{/if}
{/cf_cake_photos}
</div>
{if:else}
<div id="gallery">
<div class="slides_container">
{cf_cake_photos orderby="mtx_cake_photo_type" sort="asc" search:mtx_enable_photo="y"}
<div id="cake_{row_index}" class="slide">
{if mtx_flickr}
{exp:ce_img:single
src="{mtx_flickr size="large"}"
attributes='alt="{mtx_cake_photo_description}" title="{mtx_cake_photo_title}"'
debug="yes"
crop="no"
max_height="640"
max_width="640"
smart_scale="yes"
hide_relative_path="yes"
}
{if:else}
{exp:ce_img:single
src="{mtx_cake_image}"
crop="no"
max_height="640"
max_width="640"
smart_scale="yes"
attributes='alt="{mtx_cake_photo_description}" title="View {mtx_cake_photo_title}"'
debug="yes"
hide_relative_path="yes"
}
{/if}
</div>
{/cf_cake_photos}
</div>
</div>
<ul class="galleryPagination">
{cf_cake_photos orderby="mtx_cake_photo_type" sort="asc" search:mtx_enable_photo="y"}
<li>
<a href="#cake_{row_index}" class="caroufredsel">
{if mtx_flickr}
{exp:ce_img:single
src="{mtx_flickr size="square"}"
crop="yes"
max="75"
smart_scale="yes"
attributes='alt="Thumbnail: {mtx_cake_photo_title}" title="Show {mtx_cake_photo_title}"'
debug="yes"
hide_relative_path="yes"
}
{if:else}
{exp:ce_img:single
src="{mtx_cake_image}"
crop="yes"
max="75"
smart_scale="yes"
attributes='alt="Thumbnail: {mtx_cake_photo_title}" title="Show {mtx_cake_photo_title}"'
debug="yes"
hide_relative_path="yes"
}
{/if}
</a>
</li>
{/cf_cake_photos}
</ul>
{/if}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment