Announcement

  •  » Requests
  •  » Change banner depending on which category is selected

#1 2008-10-30 08:00:06

manute
Member
2008-06-12
13

Change banner depending on which category is selected

Hi!

I would like to know how can the banner image be changed depending on the chosen category.

Thanks in advance

Offline

 

#2 2008-10-30 08:08:54

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7207

Re: Change banner depending on which category is selected

I invite you to read


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#3 2008-10-30 10:15:13

manute
Member
2008-06-12
13

Re: Change banner depending on which category is selected

Hello!

Thanks, ddtddt. But I have not found out the way to associate a Category (not theme) to an specific banner.
I have installed "Add index" plugin, just to have an index.php file for each category, but I don't know if modifying it can be useful. Any idea would be appreciated.

(It is the same question shown in this topic : http://forum.phpwebgallery.net/viewtopic.php?id=1345)

Last edited by manute (2008-10-30 10:23:05)

Offline

 

#4 2008-10-30 11:03:15

P@t
Piwigo Team
Nice
2007-06-13
4098

Re: Change banner depending on which category is selected

Install and active LocalFiles Editor

In 5th tab (personal plugin), insert:

add_event_handler('loc_end_section_init', 'personal_banner_changer');

function personal_banner_changer()
{
  global $conf, $page;

  if (!isset($page['category']['id'])) return;

  switch ($page['category']['id'])
  {
    case 8:
      $conf['page_banner'] = 'banner for category 8';
      break;

    case 12:
      $conf['page_banner'] = 'banner for category 12';
      break;

    case 24:
      $conf['page_banner'] = 'banner for category 24';
      break;
  }
}

You have to change category number in bold...

Last edited by P@t (2008-10-30 11:03:53)


P@t

Offline

 

#5 2008-10-30 12:36:06

manute
Member
2008-06-12
13

Re: Change banner depending on which category is selected

Thank you very much, P@t! It works as I wanted!!

Offline

 
  •  » Requests
  •  » Change banner depending on which category is selected

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact