Announcement

Collapse
No announcement yet.

Head tag for single product

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

    Head tag for single product

    Is there a way to add a javascript into just a single product head tag rather than globally? I use a couple of conflicting scripts so would just like the scripts to apply to individual products. MM 4.24. Thanks.
    Barry

    #2
    Re: Head tag for single product

    Use the following in your Head Tag/CSS Template.
    Code:
    <mvt:if expr="g.product_code EQ 'your-product-code-here'">
    <script></script>
    </mvt:if>









    (Please note: the proceeding is not intended for those who have no use for 3rd-party developers or their products or services.)
    Last edited by Bruce - PhosphorMedia; 07-23-11, 10:18 AM.
    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: Head tag for single product

      Bruce, thank you. But I'm not sure I explained myself properly. This is a Miva 4 store (4.24). Yes, I know it's time to move on. I want to know if there is a way to add a script to the head tag of an individual product instead of doing so globally. I have one javascript that I would like to use in some product pages and another for some other products, but the two scripts conflict. Either a if/else statement for the global head tag that will allow me list a number of products, or, a way to access the head section for individual products, which I do not see.
      Barry

      Comment


        #4
        Re: Head tag for single product

        sorry, not use to even looking at the thread head...i know...or knew, but have forgotten how specifically, but it can be done if you have OpenUI.
        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: Head tag for single product

          Code:
          %OUI%
          %IF(g.Screen EQ 'PROD')%
          %IF(g.Product_Code EQ 'XXXX')%
          do this
          %ELSE%
          %IF(g.Product_Code EQ 'XXXX')%
          do this
          %ELSE%
          %IF(g.Product_Code EQ 'XXXX')%
          do this
          %IFEND%
          %IFEND%
          %IFEND%
          %IFEND%
          For the global header - it tests to see if you are on a product page. We do this and it works. Can be laborious if too many ifs, and be sure to close them all at the bottom of the block, not in the middle anywhere.

          Comment

          Working...
          X