Announcement

Collapse
No announcement yet.

The old swicha roo

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

    The old swicha roo

    The intent of the code is to match the category and put up the appropriate header; it goes on the CTGY page.

    This code throws this error:

    Error compiling template: Line 22: Expression compilation failed: Invalid Argument '&' Found in expression

    Is there a better variable to put in? Does the text string need to have quotes around it? ( "Fortune Cookies Giant" )

    What is the better way? Thank you.

    Code:
    <div class="cookie-header">
    
        <mvt:if expr="&mvte:category:name; EQ Fortune Cookies Giant">
        <!-- Giant: -->
        <img class="title-cards" src="graphics/en-US/twg/bgheader_01.gif" alt="Fortune Cookies"  />
        <img class="title-cards" src="graphics/en-US/twg/header-giant.jpg" alt="Giant Fortune Cookies" />
        <p>All of our Hand Made, Hand Dipped Giant Fortune Cookies are now 7 inches.<br>
        To Bookmark This Page Press (Ctrl + D)</p>    
        
        <!-- Gift Bag: -->
        <img class="title-cards" src="graphics/en-US/twg/bheader_01.gif" alt="Gift Bags"  />
        <img class="title-cards" src="graphics/en-US/twg/header-gift.jpg" alt="Gift Bag" />
        <p>Add a custom message<br>
        to your gift bag's window!<br>
        <br>
        To Bookmark This Page Press (Ctrl + D)</p>
        <mvt:else>
        <h1>Decorated</h1>
        </mvt:if>
    </div>

    #2
    Re: The old swicha roo

    Your code is close, your just using the entity vs the variable.

    You need something like this:

    Code:
        <mvt:if expr="l.settings:category:name EQ 'Fortune Cookies Giant' ">
    
    
        <mvt:else>
        
        </mvt:if>
    Any string also needs to be in single quotes.

    Here are some videos which should help

    http://www.miva.com/videos/web_developers/entities

    http://www.miva.com/videos/web_devel...ings-structure

    http://www.miva.com/videos/web_devel...nal-statements
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: The old swicha roo

      Worked like a charm!

      Code:
      <div class="cookie-header">
      
          <mvt:if expr="l.settings:category:name EQ 'Fortune Cookies Giant' ">
          <!-- Giant: -->
          <img class="title-cards" src="graphics/en-US/twg/bgheader_01.gif" alt="Fortune Cookies"  />
          <img class="title-cards" src="graphics/en-US/twg/header-giant.jpg" alt="Giant Fortune Cookies" />
          <p>All of our Hand Made, Hand Dipped Giant Fortune Cookies are now 7 inches.<br>
          To Bookmark This Page Press (Ctrl + D)</p>
      
          <mvt:elseif expr="l.settings:category:name EQ 'Fortune Cookies Baby Giant' ">    
          <!-- Baby Giant: -->
          <img class="title-cards" src="graphics/en-US/twg/bgheader_01.gif" alt="Baby Giant Fortune Cookies"  />
          <img class="title-cards" src="graphics/en-US/twg/header-babygiant.jpg" alt="Giant Fortune Cookies" />
          <p>All of our 4 inch, Hand Made, Hand Dipped Baby Giant Fortune Cookies
          are available with either a generic message and lucky numbers or
          with your very own custom message at no extra charge.
          
          To Bookmark This Page Press (Ctrl + D)
          <mvt:else>
          <h1>Decorated</h1>
          </mvt:if>
      </div>

      Comment


        #4
        Re: The old swicha roo

        You could also just populate Header of the category and just use the category header SMT item.
        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: The old swicha roo

          That would be more elegant; I just didn't find that variable.

          I have another question about finding a <div> with a specific id and insert a header as I've done; should I open a new post?

          Comment


            #6
            Re: The old swicha roo

            Its:

            Code:
            <mvt:item name="prod_ctgy_hdft" param="ctgy_header" />
            You need to also assign the item "prod_ctgy_hdf" to the page if not already assigned.
            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

            Working...
            X