Bèr I'm wondering if you would accept this feature and, if so, whether you have an opinion on how to implement it.

A site I'm working on at the moment is using sections.module only for its API. There is one template for the whole site, which varies e.g. the header image according to which section it is in.

It would be helpful if the sections interface could include a box that allows people to assign arbitrary variables that would be returned as part of the section object by sections_in_section(). This way a section could be associated with a particular background image.

The easiest way I can think of to do this is just include a text box in which people can put name = value pairs on separate lines. The contents of this box will be stored as one field in the database, parsed on load and added to the sections object.

At the moment this has to happen in page.tpl.php, which is inelegant.

Sound reasonable?

Comments

Bèr Kessels’s picture

sections module will use the regexp engine of blocs. So, it will not use any variables.
However, I do thing a good idea, would be to make a hook_section, that will be called, so that other modules can change teh sections to what they wish.
<?
function hook_sections() {
// invoke all modulename_sections, and get an array from them
$sections is module_invode_all('sections', $instaleld_themes, $active_theme);
// $sections will now have an array(array('weight'=>0, 'theme'=>'themeorstylename'))
}
?>

Care to turn thuis into a patch? Better ideas even? I wold like to hear from you.

Patrick Nelson’s picture

I'm looking to achieve something similar myself.

Willmoy, did you get any further with this? If so, could I beg a copy of your patched code?

Regards

Patrick

Patrick Nelson’s picture

Having not had a reply from the OP, I wonder if anyone can help me with this?

I have multiple sections, but only want to use one theme. I want a different image to appear in the header section of the page depending on the section. I gather this can be done by editing page.tpl.php so I don't need to create a seperate theme for each section.

Although this may be inelegant (as noted by the OP), it is still something that I would like to be able to do.

Any help welcome.

Regards

Patrick

Patrick Nelson’s picture

Apologies for previous post - I will start this again as a support request and not a feature request.

Bèr Kessels’s picture

Status: Active » Closed (duplicate)

moving this to a general "task": http://drupal.org/node/76620