21280 Posts in 5729 Topics by 2600 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 453 Views |
-
The same variable a few lines down doesn't work

13 April 2010 at 7:48am Last edited: 13 April 2010 7:49am
I have this code in a sidebar template:
<ul id="profile-menu">
<% if isPhotoAlbum %>
<li><a href="$Album.AddPhotosLink">Add Photos to this Album</a></li>
<li><a href="$Album.DeleteLink">Delete this Album</a></li>
<li class="empty"> </li>
<% end_if %>
<% if isUploadPage %>
<li><a href="$Album.DeleteLink">Delete this Album</a></li>
<li><a href="$Album.Link">Back to Album</a></li>
<% end_if %>
<li><a href="$NewAlbumLink">Create a new Album</a></li>
<% if isPhotoAlbum %>
<li><a href="$Link">Return to Photo Gallery</a></a></li>
<% end_if %>
</ul><!-- profile-menu -->The variable, $Album.DeleteLink, works just fine in the first instance it's used. In the second, in the "if isUploadPage" area, it doesn't. There is no fundamental change that occurs between the two instances that would cause it to break. The first instance prints the link just fine while the second one prints a blank.
-
Re: The same variable a few lines down doesn't work

14 April 2010 at 9:39am
Hmph.
Weird alright. That looks all good to me. Have you checked your HTML Source just to make sure it's not being hidden?
Is this link displaying or not?
<li><a href="$Album.Link">Back to Album</a></li>
If the entire block is not displaying, isUploadPage is giving you a false when you probably aren't expecting it. If it is only the DeleteLink not displaying, it just doesn't make sense.
Aaron
-
Re: The same variable a few lines down doesn't work

14 April 2010 at 11:43am
Yup, viewed source to check. The code block is printing. It's just the link that's being printed blank.
-
Re: The same variable a few lines down doesn't work

14 April 2010 at 12:14pm
Is the other link in the block printing OK?
The only possible explaination without looking at code is all the code that is running to the point where isUploadPage() fires true, does not have access to the Album object.
You might be better off posting your class and method code.
| 453 Views | ||
|
Page:
1
|
Go to Top |


