Forum OpenACS Q&A: Re: globalizing ecommerce toolbar, howto know if "in" package instance?

Right, Randy. That's the approach I am using within ecommerce --to present the toolbar on pages according to aD coders wisdom. Basically grepping for toolbar, and replacing with the property tag you mention (using variable show_toolbar_p).

I'm hoping to use "is_in_ecommerce_p" as a switch to turn on site-wide spamming of the toolbar (ec_search_widget), and importantly to turn off "default show toolbar" within ecommerce. That way the historical wisdom of displaying the toolbar within ecommerce is retained (using show_toolbar_p and OR logic).

The problem is, how to define is_in_ecommerce_p in default-master.tcl?

Is  object_id and package_id the same for package instances, just different semantics?

I'm still not comprehending your intent...

What do you mean by "site-wide spamming of the toolbar"? Do you mean that you wish to display the toolbar on pages other than ec pages? And you plan to do that by placing <include src=".../toolbar>" in the master template?

I still think that it would be more straightforward to keep an  <include> in the ec adp pages. In other words, don't replace the existing includes with a property tag, but place the property tag in the include, and pass it on to higher-level templates. Maybe replace the "src=..." attribute of the existing <include> tag to bring in a simple file that just sets a property to indicate the request is coming from an ec page.

The [ad_conn package_id] is the object_id of the package instance mounted on the site-map at the requested location. You can obtain various properties of any site-node with the site_node::get* api. You could use [ad_conn package_id] or [ad_conn location] as the seed to obtain everything there is to know about any node, including the package_key (i.e. the package name).