[Webtek-devel] Breadcrumbs
Status: Alpha
Brought to you by:
prozessor13
|
From: Adrian S. <adr...@gm...> - 2008-05-22 10:34:24
|
Is there any facility for supporting "Breadcrumbs", for example Root Page > All profiles > Profile 'x' > Edit Data I would imagine following features being necessary for a breadcrumbs system: * It would make sense to use the Parent concept already in WebTek to build the breadcrumbs (as opposed to e.g. having the breadcrumb parent/child relationship external in a config file or something) * As "Edit Data"-type screens are implemented with WebTek actions, and as they are represented by adding e.g. /edit onto the URL, it would also make sense to add them to the breadcrumbs * Obviously the breadcrumbs would be linked to the pages they represent * Breadcrumbs should be able to support data for example "Profile 'x'" for the particular profile that's being viewed. * Text localizable * Maybe an obscure point, but I think it'd be cool if the last point, e.g. "Edit Data" above, could be missed out. That way breadcrumbs would just be ".... Profile 'x' >" and the actual text of "Edit Data" could be the main heading of the page. If there is no such system, then I would be happy to build such a system. * I imagine the best place would be in a "module" * For example exposing a new tag such as <% breadcrumbs %> which is implemented by the Root page of the module * In order to follow the convention in WebTek that "templates are in control" i.e. they suck the data out of the pages with macros (as opposed to pages populating dumb templates by setting e.g. $-variables), I would create a "breadcrumb.tpl" in each Page class. * This could include a <% message %> for localization * Or any other attribute for example <% name %>. In the example above. if the "ProfileView" page (for "Profile 'x'") uses a Profile model, and that model has a "name" attribute. * Formatting done over CSS, i.e. not really a concern of the breadcrumb system. Following "programming by convention", the CSS styles would have fixed names e.g. "breadcrumbItem" which could be styled. |