Galery 3.0 Beta 3. Different Skins/Templates

kondorek

Joined: 2009-09-23
Posts: 3
Posted: Wed, 2009-09-23 16:57

Hi

Do you have some Ideas, how can I make a different .css for Album and any Photos in this Album.
(For example Album "Birds" and all Photos in Album "Birds" should have a css called birds.css)

I made something like this

page.html.php

  
  <? if ($theme->page_type == "album"): ?>
  <?= $theme->css($theme->item()->title .".css")  ?>
  <? elseif ($theme->page_type == "photo"): ?>
  <?= // but whats here ??  ?>
  <? endif ?>

Thanks for any Idea

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22890
Posted: Fri, 2009-09-25 02:28
Quote:
<?= // but whats here ?? ?>

Not tested but this should get you thinking inn the right direction:
<?= $theme->css($parent->title .".css") ?>

You might want to check in the file does exist:

if (file_exists("file_name.ext")) {
......
}

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
kondorek

Joined: 2009-09-23
Posts: 3
Posted: Fri, 2009-09-25 15:15

Thank you floridave

You show me the right way to do this
It must be changed a little :)

This work by me

  <? if ($theme->page_type == "album"): ?>
	<?= $theme->css($theme->item()->title.".css")  ?>
  <? elseif ($theme->page_type == "photo"): ?>
	<?= $theme->css($parents[1]->title .".css") ?>	 
  <? endif ?>

EDIT Of course this above plus function file_exists() for both .css additionally

Thanks
kondorek

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22890
Posted: Fri, 2009-09-25 23:05

Great, glad you got it working. Can you post a link to your site to see the behavior?
Would be nice to see the full changes you made as well.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
kondorek

Joined: 2009-09-23
Posts: 3
Posted: Sat, 2009-09-26 08:29

Hi floridave

It`s not finish yet,
Now I working only on my localhost.

Greetz
KOndorek