Announcement

Collapse
No announcement yet.

Token example

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Token example

    I'm could use some help. Here's what I am trying to do, I added the following code (without //comments) to the CTGY page .

    //read a custom category variable named step_1 and assign to a global variable

    <mvt:item name="customfields" param="Read_Product_Code(l.settings:category:code, 'step_1', g.step1)" />

    //I assigned some text (ie. Test|This is a test) to the step_1 variable at the category level via the corresponding textarea


    //if the global variable has content
    <mvt:if expr="g.step1">

    //split using token & assign title|body to global variables
    <mvt:assign name="g.step1_title" value="gettoken( g.step1, '|', 1 )" />
    <mvt:assign name="g.step1_body" value="gettoken( g.step1, '|', 2)" />
    </mvt:if>

    //print to page
    &mvt:global:step1_title;
    &mvt:global:step1_body;


    I get nothing.on the assigned category page

    Thanks.

    #2
    Hmmm...would probably need more context here...but you do have a READ PRODUCT (by product_code) and you are feeding it a Category_Code.
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      I'm not feeding it anything. I know when I created other product custom fields ie serial_number I was able to show that variable on the screen. In this case this is an alternate display page for CTGY http://www.allfrom1supply.com/roll-door-springs.html so I'm a little confused. My goal is to replace the single header image with a 'Step1|Step2|Step3|Step4 tabbed wizard of sorts to guide them through the spring selection process as some people have reported being confused by the process as listed.

      My thought was that rather than do as I've done in the past and create multiple customfields for each tab, ie tab1_title, tab1_image,tab1_image,tabe1_documents, tab1_link or whatever I would use a textarea customfield and put all of each tabs stuff in like so

      tab1_title|tab1_image|tab1_image|tabe1_documents,| tab1_link and then

      Measure Spring|some-image-path|some-document-link|some-you-tube-video|etc

      and then use the tokens to read each one into a variable that I could print it all to the screen.

      I could use a 'tab builder' app and cut and paste in the resultant html but thoughtI would play with the process myself as a learning opportunity, to see if I could get something working. It is not system critical as I could even just modify the graphic. But if it worked I might be able to apply this tabbed wizard to a few other confusing products.

      Comment


        #4
        What I meant is that, if you are on a Category (let's pretend the category is called Tab with a code of 'tab' OR a Product page with a category:code value passed in called 'tab', what you are requesting is the VALUE of the custom PRODUCT code field called 'step_1' assigned to a PRODUCT who's code is 'tab'....

        Sorry not to have any other insights, not enough coffee yet to parse the rest of the comment.
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment


          #5
          Ahhh, thanks. Amazing how many times I looked at that and missed it.

          Comment


            #6
            Worked! Thank you. I'll keep poking at this for a bit and see what I come up with.

            Comment

            Working...
            X