Quantcast
Channel: drupal.org - Site administrators
Viewing all articles
Browse latest Browse all 426

"Entity parent" settings

$
0
0

With Crumbs, you can specify token patterns to define parent paths for nodes, users and taxonomy terms (and maybe more in the future).

Admin page:
Admin > Structure > Crumbs > Entity parent > Node | User | Taxonomy term

You can specify a parent path pattern for each node type, vocabulary and user role.
Hint: "Entity token" module helps a lot!

Examples

(besides these settings you will also need to do some views configuration, to actually set up these pages)

Events
Desired breadcrumb:
Home > Board of directors > Meetings > Annual meeting 2013
(front) > board> board/meetings> node/456

Solution:
Pattern for parent path on "Event": board/meetings

News by date (*)
Desired breadcrumb:
Home > News > 2013 > April > 24 > New record-breaking figures
(front) > news> news/2013> news/2013/04> news/2013/04/24> node/123

Solution:
Pattern for parent path on "Article": news/[node:created:custom:Y/m/d]

Organic groups
Desired breadcrumb:
Home > Community > City groups > Aachen > Discussions > Let's go climbing
(home) > community> community/city-groups> node/888> node/888/forum> node/9125

Solution:
Pattern for parent path on "City group": community/city-groups
Pattern for parent path on "Group discussion": node/[node:og-group-ref:nid]/forum

That's it?
It is likely that you don't need to do anything else to get those breadcrumbs working.
This is thanks to some useful default behavior:

If none of the Crumbs plugins has any opinion on what the parent path should be, then Crumbs will simply chop off the last fragment of the path, and try if that works.
E.g.:
community is the natural parent of community/city-groups.
board is the natural parent of board/meetings.
This always works natively for the system path, and:

With the "path" plugin, this behavior is extended to path aliases.

Besides, there is still the "menu.hierarchy" plugin. You probably have a menu set up somewhere, that defines the hierarchy for most static pages.

(*) Disclaimer:
You probably want to use Views for pages like news/2013/04/24.
This is absolutely fine, but you may run into issues like this: #1914718: Crumbs on Views with Arguments/Contextual Filters

The problem: Views may not set a title for those pages.
And Crumbs will skip all breadcrumb items that don't have a title.


Viewing all articles
Browse latest Browse all 426

Trending Articles