Gallery2 PGTheme Port and Page Specific Content Gallery2 PGTheme Port and Page Specific Content
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Gallery2 PGTheme Port and Page Specific Content

Started by dereksurfs, November 25, 2006, 12:21:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dereksurfs

Hello,

I decided to attempt a Gallery2 port of their popular PGTheme.

I would say that I am about 80% finished.  You can see it here:
http://www.lightquestphoto.com/coppermine/?theme=derek

And here is the G2 version:
http://www.lightquestphoto.com/gallery2

The one thing I am not sure about is how to make page specific content which only shows up on one page type (i.e- Album, Thumbnail, Photo).

For example on the index page I have a welcome message which I don't want on the thumbnail or image pages.  The majority of work I have done has been to the template.html file.  I also added a theme.php to remove certain content (i.e.- stats, etc...) as well as CSS changes.  Is there a way to flag part of the template.html to only display content on one page or is there a better way to achieve this?

Thanks,
Derek

Gizmo

Search for and use the anycontent.php. This will show only on the main page.
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

dereksurfs

Gizmo,

Thanks for the reply.  I tried using anycontent.php. But it seems too tighly coupled with {GALLERY} to do any custom formatting with it.  I want to place the text too the left of the albums in a seperated table column.  You can see it here:
http://www.lightquestphoto.com/coppermine/?theme=derek

But that tip did lead to other threads discussing custom headers and footers which seem more flexible in terms of layout.  I just have to figure out how to only display that content on the page I want (i.e.- only main, thumbnail or photo).  I also want thumbnail page content only.  A logic switch may be best.  Is that done from the code inside the custom header/footer itself?  Such as this possibly:

<?php
if ( $_GET['album']='0') {
    
place content here;
}
?>



or
<?php
if (defined('INDEX_PHP') ){
    
place content here;
}
?>



Thanks,
-Derek

Gizmo

If you want to have a really different main (or index) page, think about using cpmFetch - http://forum.coppermine-gallery.net/index.php?board=87.0. You can create a separate index page using standard HTML and then use cpmFetch to fetch the image on the right. It can also be random if you wish!

As for the code you submitted, did it work when you tested it?
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

dereksurfs

I figured out how to use page specific content with a custom header.  This is the code I use to differentiate pages:


<?php
if($_SERVER['PHP_SELF'] == 'index.php'){
?>

Welcome message...
<?php
} elseif($_SERVER['PHP_SELF'] == 'thumbnails.php'){
?>

This album is a collection of ...
<?php

?>



This has pretty cool flexibility.  I don't know its limits yet as I am still experimenting with my layout.  But it seems like one could put alot of custom code in here for various pages (i.e. - index, thumbnails, displayimage, etc...).  I think it would be good to have more than 2 of these custom areas in future releases(i.e. - header, footer).  That way you could strategically place a number of them in different parts of the template and turn them on and off based on the context.

- Derek