Announcement

Collapse
No announcement yet.

If/Else Function

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

    If/Else Function

    Like most others, the changes to operating under MM9 caught me and my co-workers by surprise and we're working our way into better understanding what's different between how it worked for us prior to the update.

    One change that is of concern to me is the If/Else function. It fortunately works on one active code that I worked with Miva in developing, but it's not working for another that I'm using as part of testing for when we do a compete redesign of the site.

    The idea is that on the global header and footer, I have this:

    HTML Code:
    <mvt:if expr="g.Screen EQ 'test'">
    
    Followed by the coding for whatever the look for the test page appears.
    
    <mvt:else>
    
    Followed by the coding for how I want the other pages on the rest of the site to appear.
    
    </mvt:if>
    It would appear that the update has caused something where the coding for the test page has been disabled and reverts to the coding used for all the other sites.

    Granted we just got the update last night, does any one know what I can do to fix this?

    #2
    Re: If/Else Function

    Your code looks correct, and nothing in Version 9 change the template logic.

    What are you testing for that is not working?
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: If/Else Function

      I was using it in both the global header and footer settings so I can test having one page look different from the other pages in the site, or simply have one page with a different layout design from the rest of the site. Example being that I had a fixed background image in the test page while there is none for the other pages.

      Comment


        #4
        Re: If/Else Function

        That still should work. What happens now when you do it?

        Are you viewing the test page?
        Brennan Heyde
        VP Product
        Miva, Inc.
        [email protected]
        https://www.miva.com

        Comment


          #5
          Re: If/Else Function

          Brennan: What was happening is that, on the test page, the coding in the else portion was being used, not the ones that were specific for the test page (i.e. the layout matches that of how the other pages appear). It was acting as though the If/Else coding was not present.

          pbrynie: Good to hear that this is being looked into. So the bug is making it so that the page code has to be in all caps in order for it to be recognized?

          Comment


            #6
            Re: If/Else Function

            I spoke too soon. This issue is due to the fix for a security hole we implemented, therefore cannot be undone. The contents of g.Screen will always be uppercase, even if the actual page code is not. You can still test for the actual page code in the template by testing l.settings:page:code instead of g.Screen.

            Regards,
            Preston Brynie
            Software Developer
            Miva Merchant
            http://www.mivamerchant.com/

            Comment


              #7
              Re: If/Else Function

              Thanks pbrynie! Capitalizing the page code in g.Screen worked and the test page is now working as it was before the update.

              Comment


                #8
                Re: If/Else Function

                Huh?

                All page codes have to be in upper-case letters?
                Mark Romero
                ~~~~~~~~

                Comment


                  #9
                  Re: If/Else Function

                  No, it sounds like if you use g.Screen, it will contain the page code uppercased. The original page code can be in any case.
                  Gordon Currie
                  Phosphor Media - "Your Success is our Business"

                  Improve Your Customer Service | Get MORE Customers | Edit Any Document Easily | Free Modules | Follow Us on Facebook
                  phosphormedia.com

                  Comment


                    #10
                    Re: If/Else Function

                    That's going to create some far reaching concequences with previous store customizations/modules.
                    Last edited by Dan - Glendale Designs; 11-13-14, 06:50 PM.

                    Comment


                      #11
                      Re: If/Else Function

                      Yea, I have a habit of using all lower-case for custom screens to make them standout (and because all uppercase looks dwebish :) ) hopefully I touppered most of them when testing :)
                      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