I am in search of a way to check what type of file an item
is ($child.???). I want to differentiate between, for
instance, .jpg, .mov, .mpg and change the way each file is
handled. If the file is .jpg then I want my template to
show a thumbnail which links to the larger image. If the
file is a .mov/.mpg then I want to bypass the thumbnail
and href; instead, use an embed/src.
In summary:
If filetype = jpg then
href=....
elseif filetype = mov then
embed src=....
I get this to, partially (without the if/else), do what I
want by using:
[code]
{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}
{/code]
but I'd like finer control tan what that gives me.
Any possibility to accomplish this?
Posts: 32509
{if $child.mimeType == 'image/jpeg'}
...
{elseif $child.mimeType == 'image/jpeg'}
...
{else}
...
{/if}
install and activate the mime module to see a complete list of handled mime types.
Posts: 364
valiant,
Thank You. This is exactly what I was looking for.