URI Look Up

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cnelson
    Mini Mivite

    • Aug 2011
    • 45

    #1

    URI Look Up

    I am working to install power search and I am unable to get the URI look up function to work at all.

    Here is the code I am using, which is from the How-To docs
    Code:
            <mvt:assign name="l.uri:product_id" value="l.all_settings:product:id" />
            <mvt:do file="g.Module_Feature_URI_DB" name="l.have_uri" value="URI_Load_Item_Canonical( l.uri, l.settings:canonical_uri )" />
            <mvt:if expr="l.have_uri">
                <a href="&mvt:canonical_uri:canonical;" title="&mvte:product:name;">
            <mvt:else>
                <a href="/&mvts:product:name;.html" title="&mvte:product:name;">
            </mvt:if>
    This code is being used in the power search product layout template.

    The Miva engine is 5.26

    Thanks for the help. I am sure I am missing something simple with the do function.

    CN
    Calvin Nelson
    Director of Web Development
    2C Development Group
  • Brennan
    Super Moderator









    • Jun 2009
    • 3481

    #2
    Does your l.all_settings:product:id have a value? Try outputting that to the page to ensure your getting back a product id.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment

    • cnelson
      Mini Mivite

      • Aug 2011
      • 45

      #3
      My bad, that was a lightly old code chunk. I already checked that and l.all_settings returns nothing.

      l.settings:product:id; does however return a value.

      Code:
      <mvt:assign name="l.uri:product_id" value="l.settings:product:id" />
      That is what is in there now and it is still not working.
      Calvin Nelson
      Director of Web Development
      2C Development Group

      Comment

      • Brennan
        Super Moderator









        • Jun 2009
        • 3481

        #4
        See this example. Your l.uri structure needs to contain all the members listed here:

        http://docs.miva.com/code-samples/load-canonical-uri
        Brennan Heyde
        VP Product
        Miva, Inc.
        [email protected]
        https://www.miva.com

        Comment

        • cnelson
          Mini Mivite

          • Aug 2011
          • 45

          #5
          Looks like this is working now. It was a combo of the canonical object not having a value, and then the product id not being correct. Fixed now. Thanks.
          Calvin Nelson
          Director of Web Development
          2C Development Group

          Comment

          • lesliekirk
            Super Moderator











            • Aug 2008
            • 9289

            #6
            Originally posted by cnelson View Post
            Looks like this is working now. It was a combo of the canonical object not having a value, and then the product id not being correct. Fixed now. Thanks.
            Hey Calvin, would you mind posting what you used to make this work? Thanks!
            Leslie Kirk
            Miva Certified Developer
            Miva Merchant Specialist since 1997
            Previously of Webs Your Way
            (aka Leslie Nord leslienord)

            Email me: [email protected]
            www.lesliekirk.com

            Follow me: X | Facebook | Pinterest

            Comment

            Working...
            X