How to load album.tpl code with specific sub-albumId child data

Bimble

Joined: 2007-12-17
Posts: 34
Posted: Fri, 2008-04-18 17:46

Hi Folks,

I'd like to have a panel on my root page that shows partner banner links. My first approach was to create a TopLinks sub-album and then use imageBlock to display it on root, but this didnt work because imageBlock doesnt support linkObjects.

My second idea was to reuse the basic structure of the album.tpl display (which I can more or less follow), but load data from a specific sub-album, but this is where I'm stuck...

from the within album.tpl (matrix)the code starts from:

{foreach from=$theme.children item=child}
<blah> <blah>

Obviously this is loading up the children of a the current page, does anyone know how to code a call to load children of a specific sub-album into this?

Would greatly appreciate your help!

 
slydog
slydog's picture

Joined: 2008-09-05
Posts: 3
Posted: Fri, 2010-05-07 20:58

Bimble,

Did you figure this out? I'm trying to accomplish something similar.

--
John

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2010-05-07 21:05

Specific sub-album? No, I don't know how. I'd take a look at trying to use this inside either a separate PHP page or inside your template:

http://www.flashyourweb.com/staticpages/index.php?page=mediaBlock

To include PHP code in your template you can do this:

{php}
<?php @readfile('http://www.example.com/gallery2/mediaBlock.php?g2_itemId=32&mode=dynamic&g2_view=dynamicalbum.RandomAlbum&limit=11&useThumb=1&column=4&rss=1');?>
{/php}

I've never tried that inside a template so I'm not 100% sure if it'll work.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2010-05-08 08:08
Quote:
Obviously this is loading up the children of a the current page, does anyone know how to code a call to load children of a specific sub-album into this?

It's not hard, but you'd need to be quite familiar with the G2 API. The correct way to achieve this is to:

- code a module that ...
- includes the code for a Callback function ...
- that's triggered from within your template (with the appropriate Callback syntax) ...
- that loads the data and makes it available within the template ...
- then your custom data can be referred to within that template.

If you want to be really fancy you could include the extra template contents as a "block" so you can add or remove it from pages on an album-by-album or global basis from within the theme configuration page.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2010-05-08 12:04

Sounds like banner rotation.
MediaBlock can handle this easily. (Example - mediaBlock was used to rotate the inset image)
Each item it displays can have a customLink utilizing gallery's custom fields module.
The MiniSlideshow also has these capabilities.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2