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
random image from gallery2
Re: random image from gallery2
Way cool! In my spare time, I'm upgrading my personal site to CMSMS. I have growing grandchildren and I need an easy way to keep the site updated and CMSMS is perfect. I already use Gallery 1.5, but want to upgrade to Gallery 2 so I can utilize the database. I was hoping to figure out how to insert random images in the sidebar, but you've done it!
Thanks!
Thanks!