Forum OpenACS Q&A: Re: Context bar inclusion in static pages

Posted by Matthew Geddert on
i had a smiliar issue, something you may run into when you get more static pages. I wanted the files /web/openacs-4/www/programs/masters.html, to not only have a title with main page, but also list programs as a subsection. like this:
link.workspace : link.main site : link.programs : masters
To do this you can change /web/openacs-4/packages/static-pages/www/templates/static.tcl to this (note i have only made it possible to have one level of subdirectory because that is all i need - it would be easy to expand and make this a 3 or 4 subdirectory aware procedure):
ad_page_contract {

    create static page context

set url [ad_conn extra_url]
set url "StArTeR$url"
regsub -all {StArTeR([^\t]*)/([^\t]*)} $url {\1} bit1
regsub -all "/" $bit1 "" bit1
regsub -all {StArTeR([^\t]*)/} $url {} bit2

if {[string compare $bit2 ""]} {
    set context [list [list "/$bit1" "$bit1"] "$bit2"]
} else {
    set context [list "$bit1"]

set context $context

and then packages/static-pages/www/templates/static.adp just needs to have the line:

<property name="context">@context@</property>