Crumbs is a module that gives every page a trail (and a breadcrumb).
In combination with sections, this would allow a kind of inheritance of the section to sub-pages.

Example:
For a group post of node/456, we might get a trail of
: node (home)
> countries (views page)
> node/55 (country node for Sweden. alias: country/sweden)
> node/123 (city_group node for the Göteborg group)
> node/456 (group_discussion node)
> node/456/edit (node edit page)

For some of these pages we have useful aliases that allow a path-based sections configuration (Sweden). For others, we either have no aliases, or we don't want to rely on them.

For instance, we might want a special "Scandinavia" theme for everything in Sweden, Norway, Finland, that extends to all group posts and their edit pages.

It would be a pain trying to do all that with aliases.

This is why I crafted a patch for sections, that will do the following:
- Check if node/456/edit belongs to a section. If yes, return that section.
- If not, check if node/456 belongs to a section. If yes, return that section.
- If not, check if node/123 belongs to a section. If yes, return that section.
- etc.

I think that's quite nice, and was one of the motivations for the Crumbs module.
Would you be interested in this kind of thing?

Comments

donquixote’s picture

StatusFileSize
new11.31 KB

I still need to merge that new code with the changes from 6.x-1.x-dev version.
As a start, I will simply upload my modified sections.module from the 6.x-1.4 version.

All modifications are in _sections_in_section() and _sections_choose_for_path().

donquixote’s picture

Status: Active » Needs review
StatusFileSize
new3.67 KB

Here is the patch for 6.x-1.x

Note: We need to be careful with user-provided php code (drupal_eval). The idea of the patch is that _sections_choose_sections($candidates, $path) will run for a number of paths in one request, not just one. This will not work if the respective code uses global values like $_GET['q'] or menu_get_item() and friends. For these two we could simply fake it (just set $_GET['q'] on a temporary value), but that's no way bullet-proof.

I think what we need is some kind of setting to make the new functionality optional. Or a "symbolic" integration module "crumbs_sections" or "sections_crumbs", that has to be enabled or otherwise the new logic will not kick in.

donquixote’s picture

Hi.. any news?
I am going to use the modified version on a production site very soon (today, very likely). But I don't like to maintain hacked module code for too long ..

If you give some feedback, I am ready to produce a new patch with the above mentioned checkbox included! (That would be one checkbox per section)

donquixote’s picture

Just want to say, this technique does work quite ok on the site where I used it..