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

Okay, $pkg_id refers to acs-subsites.. (my tired eyes/lazy code reading)

changed default-master.tcl to:

    set ad_pkg_id [ad_conn package_id]
    set ec_pkg_id [ec_id]
    set is_in_ecommerce_p [expr $ad_pkg_id == $ec_pkg_id]

now ec_pkg_id and ad_pkg_id seem to match within ecommerce, but so does using:

    set ad_pkg_id [ad_conn object_id]

Should object_id's, package_id's or some other item be compared for this purpose?

Torben,

Another approach would be to set a property in some common ec adp component and then pass that on to the master template (unless I'm misunderstanding what you're attempting to do). I'm not at all familiar with the ec package, but a quick look at the www/index page indicates that a toolbar component is <include>ed. I'm making the assumption that the toolbar is common throughout all ec pages (granted, it's a long stretch).

If the toolbar is included in every ec page, you could place <property name="is_in_ecommerce_p">true</property> in toolbar.adp and check for it in the master template like:

<if @is_in_ecommerce_p@ defined>
...
</if>

Randy