random image from gallery2
Posted: Thu Jan 11, 2007 4:23 pm
Hi,
I am running cmsms and gallery2 (right now on different domains because cmsms will substitute another cms, therefore the new site has to be build in the background). gallery2 will not be directly embedded within cmsms, but there was a "need" to show the random image offered from gallery2 within cmsms.
short version: *yeah!*
long version:
go and create a custom tag, I named it "g2_random_image" with this content:
-------snip
//display a random image pulled from gallery2
@readfile('http://domain.tld/gallerydir/main.php?g ... _show=name');
---snap
you can play around with "g2_show=name" etc - this show=name hides (!) the filename
now you can insert the random image with {g2_random_image}
I also have put the random image on the left navigation of the site. therefore I created a global content; I named it "g2_random_image" and inserted the tag {g2_random_image}
now I edited the template and added on the right place:
---snip
{global_content name='g2_random_image'}
---snap
for now you can see the result here: http://www.lvm.at/index.php?page=impressum
on this page with both within the content and within the left navigation.
hope this helps!
greetings,
martin
I am running cmsms and gallery2 (right now on different domains because cmsms will substitute another cms, therefore the new site has to be build in the background). gallery2 will not be directly embedded within cmsms, but there was a "need" to show the random image offered from gallery2 within cmsms.
short version: *yeah!*
long version:
go and create a custom tag, I named it "g2_random_image" with this content:
-------snip
//display a random image pulled from gallery2
@readfile('http://domain.tld/gallerydir/main.php?g ... _show=name');
---snap
you can play around with "g2_show=name" etc - this show=name hides (!) the filename
now you can insert the random image with {g2_random_image}
I also have put the random image on the left navigation of the site. therefore I created a global content; I named it "g2_random_image" and inserted the tag {g2_random_image}
now I edited the template and added on the right place:
---snip
{global_content name='g2_random_image'}
---snap
for now you can see the result here: http://www.lvm.at/index.php?page=impressum
on this page with both within the content and within the left navigation.
hope this helps!
greetings,
martin