Announcement

Collapse
No announcement yet.

mvt vs mvte vs mvta clarification needed

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

    mvt vs mvte vs mvta clarification needed

    Can someone point me to a thread or document that explains when I should be using the different forms of mvt in my SMT code?

    #2
    Re: mvt vs mvte vs mvta clarification needed

    Look in the store morph docs, "working with page templates" in the section "Entry syntax"

    Nutshell:
    mvt: = no encoding
    mvta: = attribute encoded (use for html)
    mvte: = entity encoded (use to show special characters such as '<')
    Scott Bronstad
    Marketing
    Star Time Supply, Co. Inc.
    http://store.startimesupply.com

    Comment


      #3
      Re: mvt vs mvte vs mvta clarification needed

      This is from a different thread but this should help explain the difference:

      Sure, let me expand on what html entities are and I can give you some examples:

      An HTML entity is a different way of writing a html character to the screen. For example the less than character (<) has an html entity of &lt; The broswser sees this entity and knows to print the < character.

      You can read more about html entities here:

      http://www.w3schools.com/html/html_entities.asp

      So in Miva Merchant when we say entity encoded it means that it will take any special character (like the < symbol) and replace it with its html entity equivalent.

      This is very useful for security reasons. Say for example a hacker was trying to run some javascript on your site. If they pasted some javascript contained within a <script></script> tag in the first name field during checkout, on the next page when this value gets written back to the screen if we did not encode it the javascript would execute on the page which is a big security hole.

      Instead we use &mvte: to encode the input so that when it gets written back to the screen the html written would look like this &lt;script&gt; &lt;/script&gt; This would prevent it from being executed on the page.

      mvta works similar but it replaces non url characters (like spaces) with characters that are allowed in urls.

      For example if you had this url:

      http://www.mysite.com/product/my test product.html it would not work because spaces are not allowed in urls.

      Instead we would use mvta to convert the spaces to %20 which is the encoded version of the space. The url would look like this:


      http://www.mysite.com/product/my%20test%20product.html

      Its not pretty but it would allow it to work correctly.

      In Miva Merchant there is a lot of validation in the product urls so it would be hard to even get spaces in the url without doing something custom.

      Hope this helps.
      Brennan Heyde
      VP Product
      Miva, Inc.
      [email protected]
      https://www.miva.com

      Comment

      Working...
      X