Announcement

Collapse
No announcement yet.

Pulling info from url

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

    Pulling info from url

    I have set up a link on my not in catalog product images to load this url:

    http://mysite.com/merchant.mvc?Store...e&Screen=PROD&spc=gb&img=gb_col

    My intention is to use the arguments in the url to: if spc=gb then load image gb_col.jpg into the product page.

    How do I pull the args spc and gb out of my custom url?

    Tx.

    #2
    Re: Pulling info from url

    The 'Query' part of the URL (everything after ?) become what are called CGI variables. Miva already converts these to globals, so:

    spc=gb

    becomes

    g.spc = gb (or in SMT &mvt:global:spc; )
    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
      Re: Pulling info from url

      That works great!

      However, when this expression is true, It breaks the page and doesn't load the intended image.

      HTML Code:
      <mvt:if expr="g.spc EQ 'gb'">
          <img id="main_image" src="graphics/en-US/twg/large/&mvte:global:img;.jpg" alt="Gift Bag" /></div>
      </mvt:if>
      Is there some secret javascript at work here?

      Comment


        #4
        Re: Pulling info from url

        I suspect that there is something wrong with the expression:

        graphics/en-US/twg/large/&mvte:global:img;.jpg

        what does the source say?

        (BTW: If you provide a URL we can usually answer these questions directly.)
        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
          Re: Pulling info from url

          Originally posted by Bruce - PhosphorMedia View Post
          I suspect that there is something wrong with the expression:

          graphics/en-US/twg/large/&mvte:global:img;.jpg

          what does the source say?

          (BTW: If you provide a URL we can usually answer these questions directly.)
          Here is the category page: http://dev.chocolatefortunes.com/mm5...tegory_Code=GB

          I have added conditional at the end of the category loop that test for the gift bag page; if yes, then add these 5 bags on that aren't in the catalog and can be purchased by us or you can get them your self... here's the link... (it's what the client wants).

          This page is what you get when you click on a bag name or, image (notice our globals: http://dev.chocolatefortunes.com/mm5...=gb&img=gb_hol

          I just want a large image of the gift bag in the middle of the brown box.

          And as I looked over the code... I added an <mvt:else> in there and it worked!

          Thank you for your help and discussing this with me.

          Comment


            #6
            Re: Pulling info from url

            This video may also shed some light on using URL parameters:

            http://www.miva.com/videos/web_devel...get-parameters
            Brennan Heyde
            VP Product
            Miva, Inc.
            [email protected]
            https://www.miva.com

            Comment

            Working...
            X