Announcement

Collapse
No announcement yet.

Using API for URI Management

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

    Using API for URI Management

    A question about this API function:

    Code:
    <MvASSIGN NAME = "l.genuri_result" VALUE = "{ [ g.Module_Feature_URI_UT ].URI_Generate_Category_Update( l.settings:uri_category ) }">
    Am I seeing the correct result that the function does NOT replace the existing URI. It will always create a new record?

    BTW: it makes some sense to me since I don't think you want to leave the old link as unreachable?

    Thanks,

    Scott
    IDS
    Need to offer Shipping Insurance?
    Interactive Design Solutions https://www.myids.net
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    Competitive Rates, Custom Modules and Integrations, Store Integration
    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
    My T-shirt Collection is mostly MivaCon T-shirts!!

    #2
    It does whatever you behaves based on how you have the "Update Category URIs" settings in URI Management. See attached screenshot.
    Attached Files
    David Carver
    Miva, Inc. | Software Developer

    Comment


      #3
      Thanks for the transition into my follow up question. Is it possible to specify those settings programmatically? It's possible I would need to manage on the fly, per product or category code.

      Scott
      IDS
      Need to offer Shipping Insurance?
      Interactive Design Solutions https://www.myids.net
      MivaMerchant Business Partner | Certified MivaMerchant Web Developer
      Competitive Rates, Custom Modules and Integrations, Store Integration
      AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
      My T-shirt Collection is mostly MivaCon T-shirts!!

      Comment


        #4
        You can modify the values using the domain level provisioning tag "URISettings_Update" but you cannot control the values on a per product / category basis.
        David Carver
        Miva, Inc. | Software Developer

        Comment


          #5
          Cool, thanks.

          With the API, am I able to change/update an existing ctgy/prod uri to another setting? The example I might need to handle is going from Normal to a 301? Or is it the same answer?
          IOW, if I'm looping through a list of categories and test for a condition that needs to change to a 301 I need to update the global (only) settings to make it a 301 redirect, update the category record, then change back to the original if needed?

          BTW: I'm just now looking the Feature URI functions and see there are specific functions for categories and products, etc.

          Scott
          IDS
          Need to offer Shipping Insurance?
          Interactive Design Solutions https://www.myids.net
          MivaMerchant Business Partner | Certified MivaMerchant Web Developer
          Competitive Rates, Custom Modules and Integrations, Store Integration
          AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
          My T-shirt Collection is mostly MivaCon T-shirts!!

          Comment


            #6
            You could use the JSON API to import domain level provisioning. There are specific functions for categories / products but they all generate URIs based on the configured URI settings. You may be better off just creating / modifying / deleting the URIs programmatically yourself instead of relying on the URIs to be auto generated. I.e. callthe API function "ProductURI_Insert" directly
            David Carver
            Miva, Inc. | Software Developer

            Comment


              #7
              Thanks David, I thought I got all the answers needed and would be done. If there were a product with multiple URIs where a portion shouldn't be deleted, could I delete specific URIs?

              And lastly, using that _update function I asked about initially, it seems to insert duplicates. Is that possible or might I be applying the function incorrectly?

              Scott
              IDS
              Need to offer Shipping Insurance?
              Interactive Design Solutions https://www.myids.net
              MivaMerchant Business Partner | Certified MivaMerchant Web Developer
              Competitive Rates, Custom Modules and Integrations, Store Integration
              AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
              My T-shirt Collection is mostly MivaCon T-shirts!!

              Comment


                #8
                You could use the "URI_Delete" API function and pass in one of "URI_ID", "Edit_URI", or "URI" as the identifier for which URI you wanted to delete. You could also call URIList_Delete which takes a "URI_IDs" array containing the URI IDs you wish to delete.

                I would not expect the update function to insert duplicates, this could be happening based on the URI template and/or the settings configured.
                David Carver
                Miva, Inc. | Software Developer

                Comment

                Working...
                X