[solved] (ImageBlock) Random image from specific album IN main page.

lucasmarin
lucasmarin's picture

Joined: 2010-07-14
Posts: 37
Posted: Sat, 2010-07-17 09:41

Hello everyone.
With this line in templates/local/album.tpl:

{g->block type="imageblock.ImageBlock" blocks="randomImage" maxSize="500" showDate=0 showOwner=0 showViews=0 showTitle=0 showHeading=0 useDefaults=0}

i was able to put a random image in the main page. Is it possible to specify which album those random images should be from?
Like when you use an external imageblock and you use this line:

<?php @readfile('http://www.lucasmarin.com/gallery2/main.php?g2_view=imageblock.External&g2_blocks=randomImage&g2_itemId=733'); ?>

that g2_itemId is the album i want to show the images from...

any help?

Thank you very much!

http://www.lucasmarin.com

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2010-07-17 11:48

I'd assume you could simply add itemId=xx

but you can also use mediaBlock.

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

 
lucasmarin
lucasmarin's picture

Joined: 2010-07-14
Posts: 37
Posted: Sat, 2010-07-17 11:59

Hey thanks a lot! it seems to have worked! i have no idea how i didnt try it like that, so simple... i was adding g2_itemId=xx without success... but itemId=xx worked perfect! what is the difference? Thank you very much again!

http://www.lucasmarin.com

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Sat, 2010-07-17 12:31
Quote:
i was adding g2_itemId=xx without success... but itemId=xx worked perfect! what is the difference?

g2_ is the (default) prefix added to parameters in urls. A prefix may be needed there if, for example, G2 is in embedded mode and the url is an extension of a url which already has parameters intended for another web application. For instance itemId=xxxx in the url could be intended for a CMS system to display a particular page, in which a G2 image was embedded, so ensuring that Gallery2 uses g2_itemId in that context avoids a conflict.

Within a smarty template the parameter is simply itemId=... - there's no conflict and no prefices are used.

 
lucasmarin
lucasmarin's picture

Joined: 2010-07-14
Posts: 37
Posted: Sat, 2010-07-17 12:40

Well, thank you very much alec. This is really complicated, there is not like a step by step "dumbproof" tutorial, but i´m learning a lot, and with the help of everyone here in the forum my gallery is starting to be like i want it to. Thanks again!

http://www.lucasmarin.com