Labels

accessibility (2) ADF (1) archiver (3) cmu (1) contributor (13) cookie (1) DAM (3) date (3) download (3) dynamic list (4) ephox (5) fatwire (1) fck (1) filters (1) folders (4) headers (2) IBR (3) ImageAlchemy (3) java (4) javascript (2) layout/template (4) link (6) locale (2) multilingual (1) rendition (3) replicator (4) rules (1) schema (1) search (11) sites (1) sitestudio (24) ssp/sspu (5) SSUrlFieldName (2) stellent (4) timezone (1) urm (1) weblogic (1) workflow (2)

Friday 30 January 2009

Better SiteStudio "Best Practices" - Generating Navigation

Continuing my theme of scalable best-practice for SiteStudio, it's time to turn our attention to the elephant in the room - generating navigation. SiteStudio comes with dozens of "navigation" fragments that harness the power of dynamically assembling navigation from the site sections. There's plenty of fragments to choose from, they do nifty stuff... but the question nobody seems to ask is "why the hell would you build navigation out of your site sections?"

Building site navigation from site sections might make sense to a content-management developer or even a clueless contributor, but as a web developer it smacks me as fair dinkum madness. Nesting sections (directories) just for a drop-down nav? Thinks of all the redundant jumbled-up URLs, yuck. If you wanna change your nav, you gotta move around site sections, mucking up external links to your site... I could go on, but you know the issues, right?

But you were thinking "dynamically assemble nav, that sounds hi-tech and easier to manager, right?" Wrong. To add a link to your navigation, you need to create a new section with a URL, assign a layout, assign content to the regions, set the section as "include in navigation" plus any other custom section properties. Phew... not so dynamic now, eh? The dynamic bit is the fact that every time someone visits the page it needs to recalculate and reassemble the navigation based on the site hierarchy. Strewth. The nav probably changes once a blue moon yet you're wasting valuable processing power regenerating it on every single page visit. On a site with thousands of sections that's gonna be a significant slowdown! The Oracle dudes will tell you to cache it but that means whenever you do change your nav you won't see nuthin' until the cache expires. Site hierarchy as navigation is horribly impractical.

1. Generate navigation from a content item, not from site sections.
Why bother "generating" navigation when we can just use a content item? It's a CMS, remember! Create a region in your layout for navigation content. The contributor simply edits the assigned content and adds a list of links, links to whatever content or sections or URLs they feel like. Easy! Use a staticlist fragment to offer tighter control over the items, the new 10gR4 SiteStudio uses region templates to finitely control the appearance further. Standard workflow & security can be used to control the nav, it's fast and reusable, and it doesn't expose the project file (site structure) to non-designers.

2. Auto-reuse your navigation content across multiple sections.
Worried about the arduous task of assigning the nav content item to each section's layout? Simply hard-code into your layout that the nav region uses a specific content item. Better still, use a Custom Section Property (CSP) to define a starting section. Then code the layout so that all child sections use the same nav content item as the CSP parent. A site footer is also an ideal use for this approach.

5 comments:

  1. Very nice points. I would say I mostly agree. I would be worried about having a system where the navigation could get to far out from the breadcrumb and/or URL. But for the most part its a great idea to use less expensive rendering of contnet vs expensive generation. I generally use some generation but not from head to toe.

    ReplyDelete
  2. Great idea. But if more granularity security control needed, e.g. control visibility of one menu item in the static list, any suggestions? Thanks a lot.

    ReplyDelete
  3. sure thing, just add a column make it text for now, add the user role such as "admin" to the rows you want to show for that role. then call <$userHasRole(staticlist.columnnname)$> in an if block.

    Advanced features would then be to create a custom element for the list column that provided all roles or gave a list that you specify for the editor to choose from.

    One fault of this is unless you do more finagling all contributors can control the access, most likely not a problem but further coding could achieve some of that.

    ReplyDelete
  4. Hi Daniel,

    Thanks for your reply. I am thinking to develop a custom form by which user can define multiple level menu with security control.

    ReplyDelete
  5. What about the nested navigation item. Then how many static list items you are going to create?

    ReplyDelete