Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

imagegallery module different template another section of site


Go to End


6 Posts   1151 Views

Avatar
zim

Community Member, 135 Posts

26 March 2010 at 9:06am

I have implemented imagegallery module (IGM) on two different sections of my site (photos, products).

I want the album display for my products to be slightly differnt to my photos but i can not seem to change the display of 'ImageGalleryPage_album.ss'.

I have tried putting if statement in as follows but does not work.

<% if Page(productAlbum) %>...

Can anyone help?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

26 March 2010 at 9:36am

I usually tag my body with id="$URLSegment" and class="$ClassName".. that way you can make subtle changes in your CSS on a page-by-page basis without having to create new templates.

Avatar
zim

Community Member, 135 Posts

26 March 2010 at 9:53am

Cool.

I now get

<body id="what-we-sell-2" class="ImageGalleryPage">

obviously the class="ImageGalleryPage" will be the same on all imagegallery pages so

I try

<% if $URLSegment == what-we-sell-2 %>

but does not work. can I use this approach?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

26 March 2010 at 10:04am

Edited: 26/03/2010 10:04am

No, no... CSS is your friend!

body#your_id #gallery_layout { some rule }

Avatar
zim

Community Member, 135 Posts

26 March 2010 at 10:11am

perfect!

...can't believe I did not see that!

have been struggling with that for a few days..

Thanks!!

Avatar
Juanitou

Community Member, 323 Posts

26 March 2010 at 10:33pm

And don’t forget that you cannot use $ inside controls, that should work (note the single = operator):

<% if URLSegment = what-we-sell-2 %>

Hope it helps… later.