4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: taru on October 21, 2009, 09:17:13 PM
-
In my gallery every detail viewed picture at the same time is a link to the next image in the folder.
So it so easy to view all pictures to the end of the folder simply by clicking to the image.
I have change my details.html:
<div align="center">
{image}
{if admin_links}<br />
{admin_links}<br />
{endif admin_links}<br />
{lightbox_button} {postcard_button} {download_button} {download_zip_button}
</div>
to this:
<div align="center">
{if next_image_name}
<a href="{next_image_url}" alt="{image_name}" title="{image_name}">
{endif next_image_name}
{image}
{if admin_links}<br />
{admin_links}<br />
{endif admin_links}<br />
{lightbox_button} {postcard_button} {download_button} {download_zip_button}
</div>
When last image in folder is reached - nothing is happen because next_image_name is false. But I want in this case change href to {cat_url}.
How can I use if...else...endif structure here?
Or how can I use logical negation? Something like this... {if !next_image_name} ?
Could someone help me?
-
you can use {ifno tag}:
<div align="center">
{if next_image_name}
<a href="{next_image_url}" alt="{image_name}" title="{image_name}">
{endif next_image_name}
{ifno next_image_name}
<a href="{cat_url}" alt="{image_name}" title="{image_name}">
{endifno next_image_name}
{image}
</a>
{if admin_links}<br />
{admin_links}<br />
{endif admin_links}<br />
{lightbox_button} {postcard_button} {download_button} {download_zip_button}
</div>
-
Thanks V@no!
Works fine in 1.7.7!
And one more question. Is there any way to link to the first image in the folder? I think may be better when last image in folder is reached then link to the first image...
I have another site with old version 1.7.1. There don't working {ifno tag} :(
-
Is there any way to link to the first image in the folder? I think may be better when last image in folder is reached then link to the first image...
that would require little .php modification. You can leave template as it is now and in details.php find:
$next_image_id = (isset($image_id_cache[$act_key + 1])) ? $image_id_cache[$act_key + 1] : 0;
Replace it with:
$next_image_id = (isset($image_id_cache[$act_key + 1])) ? $image_id_cache[$act_key + 1] : $image_id_cache[0];
I have another site with old version 1.7.1. There don't working {ifno tag} :(
[1.7.1] Conditional tags inside other conditional tags + {ifno ...}{endifno ...} (http://www.4homepages.de/forum/index.php?topic=7493.0)
-
BIG THANKS, V@no!!! :thumbup: