4images Forum & Community
4images Issues / Ausgaben => Installation, Update & Configuration => Topic started by: Chris on September 28, 2002, 05:43:21 PM
-
I know that if the user doesn't have permission to download, a grayed out download button is displayed. I would like to conditionally remove the download button if the user doesn't have permission as this would allow me to also remove a table cell that holds it.
I also know that we can use {if XXsomeVariable} and {endif XXsomeVariable} to do this with database elements and I do this for some things.
Is there any way to do this for the download button?
-
Easiest way is to replace the images download_off.gif with a white or transparent gif.
Jan
-
Yeah I know. That's what I'm already doing. I just wanted to know if it was possible to do it directly in the templates.
-
If you are using version 1.7, try:
{if allow_download}
{download_button}
{endif allow_download}
Greets Jan
-
Thanks Jan. I'm using 1.7 and your suggestion comes close to doing what I need. In my details template I have:
{if allow_download}
<td width="70" height="20" align="center">{download_button}</td>
{endif allow_download}
But this produces html output of:
<td width="70" height="20" align="center"></td>
Usually in the templates if-endif also excludes the html. I guess this is only true for database fields as this is what can be reproduced with {if image_description}
-
Strange, this should work like you want it. All html-code should be removed between the if-endif tags. I tested it, for me it works correctly.
Jan
-
Duh! My mistake. I was looking in the wrong place. It works!
Question: Is there any support for "else"? Something like the following?
{if allow_download}
{else}
{endif allow_download}
-
No, sorry.
Jan