Member
Member
minutepapillon   2010-12-12, 10:48
#1

Hi everyone,
I need to slightly change the album.php page for a specific album (to add the description of the present image.)
I know that a theme can be affected to this album, but as this theme is barely the same as the current theme, it seems a bit heavy to duplicate it, just for a tiny modification. (Later improvements of the theme will have to be done twice etc ... boring.)
I haven't found in zp any equivalent of the child theme feature (wordpress) so I wonder if there is a more elegant way to get the job done.

Thank's for any advice !

Administrator
Administrator
acrylian   2010-12-12, 11:09
#2

The next version (or the nightly if you want to try) will contain a plugin named "mutliple_layouts" that will allow to assign special layout theme pages to all main itlems (as there are images, albums, Zenpage pages, news articles and categories)

Meanwhile you will have to do this using the object model directly (see the tutorial for that and if you haven't already the theming tutorial as well). Check for the album name with a if/else or a switch() clause and then do your special stuff.

Member
Member
minutepapillon   2010-12-24, 23:43
#3

Thanks Acrylian,
Well, I'm going to wait for the next version. The plugin you mention sounds great ...
(which one by the way ? ... in one month ? in six ? ... when should it be expected approximately ?)

... but as I'm writing these words I think "try to do the php trick yourself ... don't be such a lazy slug ..."
Being a little less stupid every day is good.
Well, let's go. Testing the name of the current album does not sound too difficult.
But testing if it is contained by an album named "shop" for example ... I don't know which function I could use ...
Any clue ?
Thanks and bye ...

Member
Member
sbillard   2010-12-25, 00:14
#4

http://www.zenphoto.org/trac/roadmap

(Of course, this is only a projection.)

Member
Member
sbillard   2010-12-25, 00:20
#5

Not exactly sure what test you are asking. But here is a guess:

$foldernames = explode('/',$_zp_current_album->name); if (array_search('shop',$foldernames) !== false)) {there is 'shop' somewhere in the album name;}

Member
Member
minutepapillon   2010-12-25, 01:10
#6

Thanks,
Waou ! ... 1.4.0 is near !
...
in the mean time, I found :
`

*you're in shop*

`
... which proves that even a total zero in php can move its little ass and find a solution ... (by the way it seems to work ...)

As you guess I don't do this to display you're in shop ...
but instead, the description of the current image (we are in album.php)

The next code (from image.php) does not work in album.php :
``
... and here ... I have no clue ...
Thanks !!

Member
Member
sbillard   2010-12-25, 03:00
#7

printImageDesc() is only valid when there is an image context setup. Like in the next_image() loop or on the image page. I would guess that you have no image at the time you called it. It would depend on where you made the call.

Member
Member
sbillard   2010-12-25, 03:02
#8

BTW, your other code has a lurking flaw. If "shop" happens to start the album name your if ($pos) will not succeed. You need if ($pos != false) to be sure. One of those strange things about PHP that you just have to get used to. The value zero is also false.

Member
Member
minutepapillon   2010-12-25, 16:31
#9

Thanks for the != false stuff.

For the printImageDesc() , I use it with the zpgalleriffic theme, in between the image and the thumbs.
Do you know if there is a way to make the image display be identified as a "current image" ?

I guess it's a specific zpgalleriffic problem ... isn't it ?

Suddently I get pessimistic ... :o( ....

Member
Member
sbillard   2010-12-26, 05:27
#10

I'm not familiar with that theme at all. If you know the image you want, look for the "makeimagecurrent" function. (or something like that, don't have the source handy at the moment)

Otherwise, maybe the theme author will step in and help.

Member
Member
minutepapillon   2010-12-28, 01:43
#11

Ok ...
Thanks for for your constantly excellent support ...

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.