testing if child is linkitem: how?
|
alecmyers
Joined: 2006-08-01
Posts: 3302 |
Posted: Tue, 2007-01-09 14:08
|
|
I'd like to modify Siriux so that linkitems are displayed with albums rather than with (childless) images. I plan to do this by modifying the album.tpl file so that this: {if $child.canContainChildren } becomes {if $child.canContainChildren || [child is a linkitem] } what do I need to test to see if the child is a link? I should add (if it isn't obvious) that I'm a total novice to Smarty, although have programming experience. Thanks for any help. |
|
| Login or register to post comments |

Posts: 259
I'm still fairly new as well so there might be a better way, but you could try
child.entityType == 'GalleryLinkItem'
Posts: 3302
Brilliant, thanks -
{if $child.canContainChildren}
becomes
{if $child.canContainChildren || $child.entityType == 'GalleryLinkItem'}
and
{if !$child.canContainChildren }
becomes
{if (!$child.canContainChildren) && $child.entityType != 'GalleryLinkItem' }
which works perfectly.
Posts: 171
I would like the linked items to be displayed as albums as well and not just the image. I am using matrix theme.
Here i have the example:
http://www.ffaabbiiaann.de/index.php?option=com_gallery2&Itemid=56&g2_itemId=7140
would your solution make the link look like the other albums? or did i get this wrong?
Fabs
_____________________________________________________
Breath in love...--------------
------------...breath out peace
Please visit my private website and the embeded gallery: http://www.ffaabbiiaann.de
Posts: 16152
fabs Yes:
http://langleycom.com/g2/main.php Don't know if it works with lightbox or not, give it a go.
talmdal Thanks!
_____________________________________________
Blog & G2 || floridave @ Gallery Team || G2 Theme Contest: +$3k in Prizes!
Posts: 171
Ok- so i replace ALL(?) instances of {if $child.canContainChildren} in album.tpl with {if $child.canContainChildren || [child is a linkitem] } and all {if !$child.canContainChildren } with {if (!$child.canContainChildren) && $child.entityType != 'GalleryLinkItem' }
Fabs
_____________________________________________________
Breath in love...--------------
------------...breath out peace
Please visit my private website and the embeded gallery: http://www.ffaabbiiaann.de
Posts: 171
forget about the following problems ! i got it all working now! seemed to be due to resistant data because i had gallery in full acceleration mode. although i always cleared the caches some things seemed to interfere still. now working! Thanks sooo much!
Fabs
_____________________________________________________
Breath in love...--------------
------------...breath out peace
Please visit my private website and the embeded gallery: http://www.ffaabbiiaann.de
Posts: 171
What statement do i have to add to also exclude movies?
So far i have this:
{if $child.canContainChildren || $child.entityType == 'GalleryLinkItem'}
The problem is that lightbox hack opens movies in lightbox but cannot play them. so i also need to exclude all movie file types.
thx for support
Fabs
_____________________________________________________
Breath in love...--------------
------------...breath out peace
Please visit my private website and the embeded gallery: http://www.ffaabbiiaann.de
Posts: 171
half solved:
i put:
{if ($child.canContainChildren || $child.entityType == 'GalleryLinkItem' || $child.entityType == 'GalleryMovieItem')}
and it works
but using lightbox for my images i would much rather have the movies open in a popup as well.
any workaround for that?
thx
fabs
_____________________________________________________
Breath in love...--------------
------------...breath out peace
Please visit my private website and the embeded gallery: http://www.ffaabbiiaann.de
Posts: 1
I second that. I've been looking into making this possible. I've gotten it mostly functional but theres a few problems.
Lightbox works by looking for the "rel" property and then updates the anchor object. An onclick event handler is added to the link. This is where the problem is. The event handler only receives the url for the image. It doesn't get things like "object type", "height" or "width". Complicating matters more, Lightbox is only setup to dynamically update an image tag.
So here is what i did:
1) update album.tpl to use rel="lightbox[photos]" or rel="lightbox[movies]" based on item type.
2) update lightbox.js to dynamically create either an image tag or an activeX movie player based on the value of rel
Heres my problems:
1) I can't tell what size the video is so i cant set the size of the player. I can set it to an arbitrary size and hope you have smaller video but thats not a great solution.
2) prev and next buttons only cycle through objects of the same type, preferably i should get both types.
At the moment it seems that the only way to get the video size is from gallery2's database and pass it in along with the URL. This would require rewriting a bit more of lightbox's code and figuring out how to get that information out of gallery2
Posts: 2
tnx for it. ;)
Posts: 171
thx but would it be possible to get a more step by step explaination. and how about the size problems.. any news on that?
thanks
Fabs
_____________________________________________________
Breath in love...--------------
------------...breath out peace
Please visit my private website and the embeded gallery: http://www.ffaabbiiaann.de