Re: Setting values in tags
Mike Heins <[email protected]> Tue, 12 Jun 2018 07:49:14 -0400
| Newsgroups | gmane.comp.web.interchange.users |
|---|---|
| Message-ID | <[email protected]> |
Quoting Ren?? ([email protected]): > Hi All! > > I am trying to solve probably a very easy problem, but currently my > brain just stands still and won't help me :-( > > I'm replacing the product_tree-menu with a Bootstrap accordion-menu, > and I want it to keep the menu open at the right product_group when > I'm browsing down to item-level or category-level. > > To be able to catch the current product_group and category, i have > modified the ncheck_category-tag to save the current prod_group and > category by adding this to the right place of the tag: > > $::Values->{prod_group} = "$prod_group"; > $::Values->{category} = "$category"; > > I get these values nicely set, but they tend to get "stuck", so if i > get to a non-product page like index.html, these values are still > with the old value set, and they get cleared only after a > page-refresh.. > > What should i do so that i can use the session for storing values > that are valid only for the current page, and are "forgotten" when > the next page is loadedd or the value is not more set by the > ncheck_category.tag? > > Best Regards from Finland Probably the best place is $Tmp: $Tmp->{prod_group} = "$prod_group"; $Tmp->{category} = "$category"; If you are global and in a different package than Vend::Interpolate: $Vend::Interpolate::Tmp->{prod_group} = "$prod_group"; $Vend::Interpolate::Tmp->{category} = "$category"; Then they can be accessed with: [tv prod_group] -- The longer I live, the more I realize the impact of attitude on my life. ... I am convinced that life is 10% what happens to me and 90% how I react to it. And so it is for you... we are in charge of our attitudes. -- Charles Swindoll