Announcement

Collapse
No announcement yet.

Modify Miva SEO Short Link Functionality

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

    Modify Miva SEO Short Link Functionality

    I'm pretty new to Miva development, and I'm looking for areas where I can tweak functionality with a module where I previously would customize things in the template language. One such area is in the SEO short links. All I want to do is add a simple modification to the built-in module for product links. Instead of:

    domain.com/product/code.html

    I want:

    domain.com/product/code/name.html

    I found a file in the LSK called seo_include.mv which has a function called SEOSettings_Product_URL_with that I can easily edit to make this change, but it looks like that file is included by half a dozen other modules that build links. I hadn't planned to customize that many modules and am assuming there's a simpler way to do this that I just don't know about. I really wished that seo_include.mv was actually a standalone helper module that I could customize as a single point to make this change.

    I've seen references in this forum to lots of other modules that exist for short links, so maybe this whole idea is overkill. Any suggestions would be appreciated.

    Thanks,
    Josh

    #2
    Re: Modify Miva SEO Short Link Functionality

    Your going to be better off not modifying the module file itself and instead making this change via the .htaccess file. The only trade off, is you will need to manually update your links in the page template to this new structure. The other issue you'll have is with the product name, there are usually characters that cannot be used in URLs and you'll want to remove spaces and replace with dashes.

    You'll need to modify your .htaccess file to support the URL structure you're looking for.

    Code:
    RewriteCond %{REQUEST_FILENAME} !-s
    RewriteRule ^/product/([^/.]+)/([^/.]+).html$ /mm5/merchant.mvc?Screen=PROD&Product_code=$1 [QSA,L]


    9.0004 should contain a complete revamp of our SEO settings and make doing URLs like this much easier. If you can wait (due out sometime this summer), that may be your best option.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Modify Miva SEO Short Link Functionality

      Thanks Brennan. What you're describing is pretty much what we're doing now. I was just hoping for a cleaner approach since we're doing a fresh store redesign anyways. Like you said, we have a bunch of code that cleans up the product names, and we have to manually build the links all over the site. It seems like it would be easier to have that done server side rather than in the templates.

      It's good that this is getting added in a future release. Unfortunately, we're rolling out our changes in a couple of weeks. However, I might go back and do a template clean-up after it's out and start using it.

      Thanks again for your help.

      Josh

      Comment


        #4
        Re: Modify Miva SEO Short Link Functionality

        Well, what I actually ended up doing is writing a simple helper module to create the product links for me. My main concern was that I didn't want to put the formatting rules for the product names in every template where they're needed, so I put them in a module instead. Now I just call that wherever I want to put a product link. I still had to update several templates, but it's a lot less code in each. Plus, should the need arise, I can just make tweaks in one place instead of, well, a lot of places.

        As a side note, it seems like the developer resources and documentation have improved a lot recently. As minimal as my module-writing efforts have been so far, it's a really big step from not even knowing where to begin and having a hard time finding information just a few years ago when we first moved our stores to this platform. Kudos to the team for making this a priority.


        Thanks,
        Josh

        Comment

        Working...
        X