Discussion:
[ic] Setting values in tags
René
2018-06-12 11:34:44 UTC
Permalink
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

René
Mike Heins
2018-06-12 11:49:14 UTC
Permalink
Post by René
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
$::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
Gert van der Spoel
2018-06-12 12:25:57 UTC
Permalink
-----Original Message-----
Sent: Tuesday, June 12, 2018 14:49
Subject: Re: [ic] Setting values in tags
Post by René
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
$::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
$Tmp->{prod_group} = "$prod_group";
$Tmp->{category} = "$category";
$Vend::Interpolate::Tmp->{prod_group} = "$prod_group";
$Vend::Interpolate::Tmp->{category} = "$category";
[tv prod_group]
Mike still has it! ;)
Mike Heins
2018-06-12 12:28:42 UTC
Permalink
When my carpal tunnel surgery happens, maybe even a bit more. I can hope!
-----Original Message-----
interchange-users-
Sent: Tuesday, June 12, 2018 14:49
Subject: Re: [ic] Setting values in tags
Post by René
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
$::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
$Tmp->{prod_group} = "$prod_group";
$Tmp->{category} = "$category";
$Vend::Interpolate::Tmp->{prod_group} = "$prod_group";
$Vend::Interpolate::Tmp->{category} = "$category";
[tv prod_group]
Mike still has it! ;)
_______________________________________________
interchange-users mailing list
http://www.icdevgroup.org/mailman/listinfo/interchange-users
--
Just because something is obviously happening doesn't mean something
obvious is happening. --Larry Wall
Gert van der Spoel
2018-06-12 12:34:15 UTC
Permalink
Good luck Mike, hope you’ll recover fast!



From: interchange-users-***@icdevgroup.org [mailto:interchange-users-***@icdevgroup.org] On Behalf Of Mike Heins
Sent: Tuesday, June 12, 2018 15:29
To: interchange-***@icdevgroup.org
Subject: Re: [ic] Setting values in tags



When my carpal tunnel surgery happens, maybe even a bit more. I can hope!
-----Original Message-----
Sent: Tuesday, June 12, 2018 14:49
Subject: Re: [ic] Setting values in tags
Post by René
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
$::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
$Tmp->{prod_group} = "$prod_group";
$Tmp->{category} = "$category";
$Vend::Interpolate::Tmp->{prod_group} = "$prod_group";
$Vend::Interpolate::Tmp->{category} = "$category";
[tv prod_group]
Mike still has it! ;)



_______________________________________________
interchange-users mailing list
interchange-***@icdevgroup.org <mailto:interchange-***@icdevgroup.org>
http://www.icdevgroup.org/mailman/listinfo/interchange-users
--
Just because something is obviously happening doesn't mean something
obvious is happening. --Larry Wall
kerry
2018-06-12 12:47:42 UTC
Permalink
Mike, I was unaware, but best of luck!
Kerry
Good luck Mike, hope you’ll recover fast!
 
*Sent:* Tuesday, June 12, 2018 15:29
*Subject:* Re: [ic] Setting values in tags
 
When my carpal tunnel surgery happens, maybe even a bit more. I can hope!
 
-----Original Message-----
[mailto:interchange-users- <mailto:interchange-users->
Of Mike Heins
Sent: Tuesday, June 12, 2018 14:49
Subject: Re: [ic] Setting values in tags
Post by René
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
$::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
Post by René
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
Post by René
are valid only for the current page, and are "forgotten" when
the next
Post by René
page is loadedd or the value is not more set by the
ncheck_category.tag?
Best Regards from Finland
  $Tmp->{prod_group} = "$prod_group";
  $Tmp->{category} = "$category";
  $Vend::Interpolate::Tmp->{prod_group} = "$prod_group";
$Vend::Interpolate::Tmp->{category} = "$category";
       [tv prod_group]
Mike still has it! ;)
_______________________________________________
interchange-users mailing list
http://www.icdevgroup.org/mailman/listinfo/interchange-users
<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.icdevgroup.org%2fmailman%2flistinfo%2finterchange-users&c=E,1,CVeFJRhe5CprrTLJ7ernDwIsJf2VpJwX4UuX2N1i2APmdhAz2i6RnbYFc7QVViNA_1ewg4Cs6qO4ztcylsuK4QYpNET9TzeAkIfD0DV2PvgxtzftGQ,,&typo=0>
--
Just because something is obviously happening doesn't mean something
obvious is happening. --Larry Wall
_______________________________________________
interchange-users mailing list
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.icdevgroup.org%2fmailman%2flistinfo%2finterchange-users&c=E,1,l5T7YhPNd9Lgq172Zh21r6gI_NeXdW1zQ2dvARRl7MFbkgyOVpVgAylTChwB27ObAibFM-b8IUyALHdFEbac1wxfzcd96hY4A2zFbSnPnpCD2JuVfOLOsW3D20HS&typo=0
--
BasicQ Inc.
PO Box 381
Boca Raton, FL 33429

Phone: 800-448-0665
email: ***@basicq.com
www.basicq.com
https://johnson.basicq.com
marco
2018-06-12 12:57:19 UTC
Permalink
In bocca al lupo anche dall'Italia.
Good luck Mike !

Marco
Post by kerry
Mike, I was unaware, but best of luck!
Kerry
Good luck Mike, hope you’ll recover fast!
*Sent:* Tuesday, June 12, 2018 15:29
*Subject:* Re: [ic] Setting values in tags
When my carpal tunnel surgery happens, maybe even a bit more. I can hope!
-----Original Message-----
[mailto:interchange-users- <mailto:interchange-users->
Of Mike Heins
Sent: Tuesday, June 12, 2018 14:49
Subject: Re: [ic] Setting values in tags
Post by René
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
$::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
Post by René
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
Post by René
are valid only for the current page, and are "forgotten" when
the next
Post by René
page is loadedd or the value is not more set by the
ncheck_category.tag?
Best Regards from Finland
$Tmp->{prod_group} = "$prod_group";
$Tmp->{category} = "$category";
$Vend::Interpolate::Tmp->{prod_group} = "$prod_group";
$Vend::Interpolate::Tmp->{category} = "$category";
[tv prod_group]
Mike still has it! ;)
_______________________________________________
interchange-users mailing list
http://www.icdevgroup.org/mailman/listinfo/interchange-users
<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.icdevgroup.org%2fmailman%2flistinfo%2finterchange-users&c=E,1,CVeFJRhe5CprrTLJ7ernDwIsJf2VpJwX4UuX2N1i2APmdhAz2i6RnbYFc7QVViNA_1ewg4Cs6qO4ztcylsuK4QYpNET9TzeAkIfD0DV2PvgxtzftGQ,,&typo=0>
--
Just because something is obviously happening doesn't mean something
obvious is happening. --Larry Wall
_______________________________________________
interchange-users mailing list
https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.icdevgroup.org%2fmailman%2flistinfo%2finterchange-users&c=E,1,l5T7YhPNd9Lgq172Zh21r6gI_NeXdW1zQ2dvARRl7MFbkgyOVpVgAylTChwB27ObAibFM-b8IUyALHdFEbac1wxfzcd96hY4A2zFbSnPnpCD2JuVfOLOsW3D20HS&typo=0
--
"Fino alla bara sinpara"
"Up to demise we rize"
René
2018-06-12 14:18:18 UTC
Permalink
Good luck Mike, hope you’ll recover fast!
Yeah, wishing you all the best and a quick recovery!

René
René
2018-06-12 14:15:40 UTC
Permalink
Post by Mike Heins
$Tmp->{prod_group} = "$prod_group";
$Tmp->{category} = "$category";
$Vend::Interpolate::Tmp->{prod_group} = "$prod_group";
$Vend::Interpolate::Tmp->{category} = "$category";
[tv prod_group]
Fantastic!! Works like a charm

Thanks Mike!

René
René
2018-06-12 14:22:09 UTC
Permalink
Post by René
   $Tmp->{prod_group} = "$prod_group";
   $Tmp->{category} = "$category";
   $Vend::Interpolate::Tmp->{prod_group} = "$prod_group";
   $Vend::Interpolate::Tmp->{category} = "$category";
     [tv prod_group]
Fantastic!! Works like a charm
Thanks Mike!
René
I stumbled now into a new problem.. :-( Is there a way to get eg the
current sku from the flypage into a template-component?

René
Gert van der Spoel
2018-06-13 07:41:21 UTC
Permalink
-----Original Message-----
Sent: Tuesday, June 12, 2018 17:22
Subject: Re: [ic] Setting values in tags
$Tmp->{prod_group} = "$prod_group"; > $Tmp->{category} =
"$category"; > > If you are global and in a different package than
$Vend::Interpolate::Tmp->{prod_group} = "$prod_group"; >
$Vend::Interpolate::Tmp->{category} = "$category"; > > Then they can
[tv prod_group]
Fantastic!! Works like a charm
Thanks Mike!
René
I stumbled now into a new problem.. :-( Is there a way to get eg the current
sku from the flypage into a template-component?
Using scratch?

http://www.icdevgroup.org/xmldocs/glossary/scratch.html
René
2018-06-13 10:14:13 UTC
Permalink
Post by Gert van der Spoel
I stumbled now into a new problem.. :-( Is there a way to get eg the current
sku from the flypage into a template-component?
Using scratch?
http://www.icdevgroup.org/xmldocs/glossary/scratch.html
I tried that:

Adding this on flypage.html
[set foocode][item-code][/set]
[scratch foocode]

This shows the item-code on every page correctly

Adding [scratch foocode] to a component like product_tree and setting
the foocode-scratch on flypage.htm displays the item-code with one page
delay, so if i load items in this order

page Scratch-value in product_tree
site.tld/item1 [empty]
site.tld/item2 item1
site.tld/item3 item2

I remember there was some trick to get this done, but i can't remember
it anymore :-(

René
Mike Heins
2018-06-13 11:32:15 UTC
Permalink
Post by René
I stumbled now into a new problem.. :-( Is there a way to get eg the
Post by Gert van der Spoel
Post by René
current
sku from the flypage into a template-component?
Using scratch?
http://www.icdevgroup.org/xmldocs/glossary/scratch.html
Adding this on flypage.html
[set foocode][item-code][/set]
[scratch foocode]
This shows the item-code on every page correctly
Adding [scratch foocode] to a component like product_tree and setting the
foocode-scratch on flypage.htm displays the item-code with one page delay,
so if i load items in this order
page Scratch-value in product_tree
site.tld/item1 [empty]
site.tld/item2 item1
site.tld/item3 item2
I remember there was some trick to get this done, but i can't remember it
anymore :-(
You can find stuff like that in the source. If you are in global code, i.e.
your tag, you can use this to set a $Tmp value:

$Vend::Interpolate::Tmp->{flypart} = $Vend::FlyPart;
René
2018-06-13 12:14:41 UTC
Permalink
Post by Mike Heins
You can find stuff like that in the source. If you are in global
$Vend::Interpolate::Tmp->{flypart} = $Vend::FlyPart;
I got this to work from the global usertag to the local
template-component, but not by setting it on the flypage. I guess that
my problem is parsing-order, and i would need to get the item-code
before the parsing starts..

I'm not so good in finding what is done where in the source, but if you
could point me the right direction then i'm pretty sure that i could
find me around :-)

René
René
2018-06-13 12:20:23 UTC
Permalink
Post by René
Post by Mike Heins
You can find stuff like that in the source. If you are in global
$Vend::Interpolate::Tmp->{flypart} = $Vend::FlyPart;
I got this to work from the global usertag to the local
template-component, but not by setting it on the flypage. I guess that
my problem is parsing-order, and i would need to get the item-code
before the parsing starts..
I'm not so good in finding what is done where in the source, but if you
could point me the right direction then i'm pretty sure that i could
find me around :-)
Bingo :-) I think i got it: [data session last_url]

René
René
2018-06-13 12:40:30 UTC
Permalink
Post by René
Bingo :-) I think i got it: [data session last_url]
There might be a more elegant way, but with this i got it to work :-)

$flycode = $Session->{last_url};
$flycode =~ s|^/(.*)|$1|;
$fly_prod_group = $Tag->data( 'products', 'prod_group', $flycode);

René

Loading...