Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Invoking custom header/footer  (Read 6560 times)

0 Members and 1 Guest are viewing this topic.

DaMysterious

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • My CPG Recources
    • My CPG Recources
Invoking custom header/footer
« on: April 25, 2009, 01:11:45 am »

Since 1.4.x we have the ability to invoke a custom header/footer from in the theme configuration. As my themes will have a custom header/and footer for 1.5.x which suites the theme (some did already in 1.4.x), is it possible to have that link directing by default through the used/chosen theme or can this be overruled in theme.php?

Simply specify a file name like "include_custom_header.html" instead of the path info e.g. themes\prorandom\include_custom_header.html would be more logical at that place thought.


Edit: Sorry to have bothered you, after some sleep I was able to modify header and footer function in theme.php that way to display custom header/footer as I would like to have for my themes.

Code: [Select]
    $filename = './themes/' . $CONFIG['theme'] . '/include_custom_header.html';
   
    if (file_exists($filename)) {
        $custom_header = cpg_get_custom_include($filename);
    } else {
        return false;
    }
« Last Edit: April 25, 2009, 11:19:07 am by DaMysterious »
Logged
DaMysterious.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Invoking custom header/footer
« Reply #1 on: April 25, 2009, 07:06:06 pm »

The custom header and footer are just config vars, so they can be overriden in your theme.php as any other config var. Use
Code: [Select]
$config['custom_header_path'] = 'foo/bar/whatever';
$config['custom_footer_path'] = 'foo/bar/whatever';
although I'm strongly opposed to the idea of a theme designer to abuse that variable: you can easily use a regular include in your custom theme, so why remove the feature for the end user: the custom header and footer includes are meant to enable users to include their custom, dynamic content, not yours.
If you should abuse the custom header and footer variables, your theme will not be listed on our demo, as we use the feature to include the overall site navigation and the theme and language selectors in a different way than usual.
If you need includes in your theme, modify the pageheader and pagefooter functions instead of messing with the variables that is meant to provide fexibility to end users. It's not meant to provide a tool for theme designers, and I simply can not see a legitimate point in abusing the variables.

Don't get me wrong: I understand that you're exited about cpg1.5.x and we welcome your contributions. However, I find it a bit pre-mature to start creating a lot of fresh themes for cpg1.5.x as long as there is no public beta you could build against and as long as the theming section in the docs is still pretty empty (because the theming engine may still be subject of change).
This being said, I suggest developing visually and not in terms of functionality yet.
Logged

DaMysterious

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • My CPG Recources
    • My CPG Recources
Re: Invoking custom header/footer
« Reply #2 on: April 25, 2009, 10:31:30 pm »

This is your kind of view, and possible you might have it on the right hand. I'm not busy to create a bunch of themes for 1.5.x which is in early beta I'm just playing around to get deeper into the secrets to be prepared when 1.5.x will become final, nothing more and nothing less.

The content of included custom header/footer will nothing more carry out as a theme fitting html skeleton users can put their dynamic content into. No word where written about content of my own as you are suggesting.

Your words are as always harsh and hard using therms such as pre-mature, abuse, messing etc. I personally have to watch out not to read your reply as a thread.

Thanks for the variable hint. Those variables will read the existing path info already given in theme configuration only, not the recent theme name which is needed to show custom header/footer from a certain theme automatically. A bit short sighted of you to try to prevent future users of 1.5.x from value ad feature contributions.

There is no need to discuss this further.
« Last Edit: April 25, 2009, 10:50:00 pm by DaMysterious »
Logged
DaMysterious.
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.