Announcement

Collapse
No announcement yet.

Help with If/Else Control Statement tags

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

    Help with If/Else Control Statement tags

    Not sure if this can be done, but thanks in advance for any help.

    Trying to get this section of code to not display on page if the product footer section is blank.

    <h2>What our customers are saying</h2>
    <div>
    <mvt:item name="prod_ctgy_hdft" param="prod_footer" />
    <p><a href="mailto:[email protected]?subject=Comments on the &mvt:product:name; laptop bag">Send us your comments.</a></p>
    </div>

    So right now if I add something in my product footer, it will display in this section above.
    See example "what our customers are saying" section on this page: http://www.rainebrooke.com/product/allie.html

    If I have a product where the product footer is blank, I would like the "what are customers are saying" section to not show at all.
    Here is a example product where the product footer is blank:
    http://www.rainebrooke.com/product/94839.html

    Is it possible to use a statement that will not display the code above on the product page if the product footer is blank?

    #2
    Re: Help with If/Else Control Statement tags

    Can anyone help with this? (see above)
    Last edited by emione; 03-08-11, 10:14 AM.

    Comment


      #3
      Re: Help with If/Else Control Statement tags

      I'd look at a page with LATU turned on and see if you have a variable you can compare against (if g.xxx, then display yyy)
      Scott Bronstad
      Marketing
      Star Time Supply, Co. Inc.
      http://store.startimesupply.com

      Comment


        #4
        Re: Help with If/Else Control Statement tags

        Originally posted by sbronstad View Post
        I'd look at a page with LATU turned on and see if you have a variable you can compare against (if g.xxx, then display yyy)
        Thanks for the reply Scott, but I'm not sure what you're trying to explain. LATU?

        Comment


          #5
          Re: Help with If/Else Control Statement tags

          Latu is a module that lets you see all the available local and global variables on a page. It has some limitations, but is a huge asset in comparison statements. You can get it free! Go to the module store, look up LATU, and download that sucker.
          Scott Bronstad
          Marketing
          Star Time Supply, Co. Inc.
          http://store.startimesupply.com

          Comment


            #6
            Re: Help with If/Else Control Statement tags

            Originally posted by sbronstad View Post
            Latu is a module that lets you see all the available local and global variables on a page. It has some limitations, but is a huge asset in comparison statements. You can get it free! Go to the module store, look up LATU, and download that sucker.
            Looked, but nothing listed like you mentioned... only other LATU modules.

            Isn't there some way of doing what I want with a
            <mvt:if expr="NOT ISNULL ????somethinghere???? ">
            type of tag?

            Comment


              #7
              Re: Help with If/Else Control Statement tags

              found it at http://store.latu.net/miva-modules-5/index.html

              look for storehelper... your logic is correct-- LATU helps you find out what the "???somethinghere???" is...
              Scott Bronstad
              Marketing
              Star Time Supply, Co. Inc.
              http://store.startimesupply.com

              Comment


                #8
                Re: Help with If/Else Control Statement tags

                Originally posted by sbronstad View Post
                found it at http://store.latu.net/miva-modules-5/index.html

                look for storehelper... your logic is correct-- LATU helps you find out what the "???somethinghere???" is...
                Ah Ha.. thank you!
                Hopefully this helps me find it.

                Comment


                  #9
                  Re: Help with If/Else Control Statement tags

                  I don't believe there is a way to test if the product or category header footer is null or empty since there is no variable to test for. It is an item that is being pulled into the page.

                  I think you will have to add the What Our Customers are Saying to the header itself for each product you want this to show on.
                  Brennan Heyde
                  VP Product
                  Miva, Inc.
                  [email protected]
                  https://www.miva.com

                  Comment


                    #10
                    Re: Help with If/Else Control Statement tags

                    Originally posted by sbronstad View Post
                    found it at http://store.latu.net/miva-modules-5/index.html

                    look for storehelper... your logic is correct-- LATU helps you find out what the "???somethinghere???" is...
                    Originally posted by Brennan View Post
                    I don't believe there is a way to test if the product or category header footer is null or empty since there is no variable to test for. It is an item that is being pulled into the page.

                    I think you will have to add the What Our Customers are Saying to the header itself for each product you want this to show on.
                    Thanks Scott & Brennan for your comments. Your comments helped me think through a way to do it.

                    What I did is create a custom product field. If the custom field is null it will show the "what our customers are saying" section. If the custom field is notnull then it turns off this section.

                    Here's the code I used:

                    <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields :custcomments">
                    <mvt:else>
                    <h2>What our customers are saying</h2>
                    <div>
                    <mvt:item name="prod_ctgy_hdft" param="prod_footer" />
                    <p><a href="mailto:[email protected]?subject=Comments on the &mvt:product:name; laptop bag">Send us your comments.</a></p>
                    </div>
                    </mvt:if>
                    Last edited by emione; 03-08-11, 02:07 PM.

                    Comment


                      #11
                      Re: Help with If/Else Control Statement tags

                      good solution...
                      Scott Bronstad
                      Marketing
                      Star Time Supply, Co. Inc.
                      http://store.startimesupply.com

                      Comment


                        #12
                        Re: Help with If/Else Control Statement tags

                        another solution would be to just include the heading "What our customers say" in the Product Footer. No custom field, no extra logic for Merchant to parse through.
                        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


                          #13
                          Re: Help with If/Else Control Statement tags

                          Using toolbelt you can load any category and product header and footer into a variable.

                          <mvt:item name="ry_toolbelt" param="lookup|ctgy_header|g.cathead|g.catcode_expr ession" />
                          <mvt:item name="ry_toolbelt" param="lookup|ctgy_footer|g.catfoot|g.catcode_expr ession" />

                          <mvt:item name="ry_toolbelt" param="lookup|prod_header|g.prodhead|g.prodcode_ex pression" />
                          <mvt:item name="ry_toolbelt" param="lookup|prod_footer|g.prodfoot|g.prodcode_ex pression" />


                          Then you can test the variable.

                          <mvt:if expr="g.prodhead">
                          Do something
                          <mvt:else>
                          Do something else
                          </mvt:if>
                          Ray Yates
                          "If I have seen further, it is by standing on the shoulders of giants."
                          --- Sir Isaac Newton

                          Comment


                            #14
                            Re: Help with If/Else Control Statement tags

                            Bringing up an old thread to see if detecting if the header/footer fields can now have a conditional to detect in their is content in them.
                            Last edited by lesliekirk; 06-30-15, 10:03 AM.
                            Leslie Kirk
                            Miva Certified Developer
                            Miva Merchant Specialist since 1997
                            Previously of Webs Your Way
                            (aka Leslie Nord leslienord)

                            Email me: [email protected]
                            www.lesliekirk.com

                            Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                            Comment

                            Working...
                            X