Announcement

Collapse
No announcement yet.

Error in Condition: Variable "Section Level" is used out of context.

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

    Error in Condition: Variable "Section Level" is used out of context.

    Hi

    I pressed the Offline Preview button and got Coding Errors:

    Error in Condition: Variable "Section Level" is used out of context.

    Double-click on the error brings me to a line of code:

    <actinic:block if="<actinic:variable name="SectionLevel" />>0 " >

    This is to display a "Back" link in the menu when looking at the products page. Coding error or not - When I press the Offline Preview again - it works, including the displaying or non displaying of the back button.

    If this is an error, what is the correct way of doing this?

    Stapes

    #2
    I get this all the time too, select design tab and then go back to content tree and it will not bring up the error. It's flaky and needs sorting out, especially when launching a site for client, they panic as they should do, only for us to tell them 'it's fine i assure you, just actinic being flaky'.

    Comment


      #3
      This normally happens because 'SectionLevel' is a variable that only works on section pages. So this variable gives an error on brochure pages, cart pages etc. This is often why you get a coding error when the full site coding check happens, but the error appears to disappear in the Design tab - (i.e. if you are looking at a section in the Design tab).

      The way around this is that any expression that uses 'SectionLevel' should be wrapped in another block if that says:

      PageType == "Section"

      Comment


        #4
        It appears to completely ignore the blockif around a variable when not on a section page, if for example you have added a heading on your shop top page. I have a site that regularly fails with a coding error warning on upload, run the upload immediately after and no warnings at all, when all i have done is click ok to stop the upload and then restarted it. I will try it with adding a condition of AND pagetype = section to the blockif etc and see if that solves it.

        Cheers

        Comment


          #5
          In fact no, i'm talking complete crap, i just checked it and i have already implemented that and tried it myself:

          Code:
          <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3d%3d%200%20AND%20%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%27Section%27" ><h1>SiteName</h1>
          </actinic:block>
          It still fails.

          Comment


            #6
            Does it make a difference it you use 2 separate blockifs, Lee?
            one round the other (round the content) IYSWIM
            Tracey

            Comment


              #7
              Gotcha, the AND part of my block if extracted and added as a new one around the existing one. Will try it and see, BUT WHY!!!!!!!!!!!!!

              Comment


                #8
                Gotcha, the AND part of my block if extracted and added as a new one around the existing one. Will try it and see, BUT WHY!!!!!!!!!!!!!
                It's just because the very presence of the 'SectionLevel' variable - even within a condition - causes the error on non-section pages.

                Another thing I've found that works well is to create conditions such as

                PageType == "Section" AND SectionLevel == 1

                within the 'Conditions' tab of the library, and then you can call them into any page whenever you need them without getting an error.

                Comment


                  #9
                  Hi Chris,

                  I've been searching thourgh all the posts regarding 'out of context errors' and I assume this is why I'm getting errors when trying to do the following for a Social Bookmarking site url

                  href="http://del.icio.us/post?url=http://www.glitzy-weddings.co.uk/acatalog/<actinic:variable name="SectionPageName" />&amp;title=<actinic:variable name="SectionPageTitle" />">

                  I'm not sure what you mean in your last post about getting around the problem.
                  Regards
                  Sally

                  Fashion Jewellery Wholesale - Glitzy Jewels

                  Comment


                    #10
                    Anyone able to help with the previous post please.
                    Regards
                    Sally

                    Fashion Jewellery Wholesale - Glitzy Jewels

                    Comment


                      #11
                      Originally posted by sally01 View Post
                      Anyone able to help with the previous post please.
                      What exactly are you trying to do?

                      Army Gore-tex
                      Winter Climbing Mitts
                      webD's Blog: Website design, SEO and other ramblings…
                      Twitter LinkedIN

                      If you think a post is good, rate it!

                      Find the answers in the Knowledge Base | Have you read the User Guides

                      Comment


                        #12
                        Originally posted by DenbighArmySurp View Post
                        What exactly are you trying to do?
                        Having read it a few times earlier, I thought exactly the same.

                        Comment


                          #13
                          Sorry guys didnt really explain it very well.

                          I'm trying to achieve dynamic bookmarking for some of the social bookmark sites now around. (ie Digg, Delicious etc) Therefore if someone wanted to bookmark a specific page on our site with Delicious to pass onto their friends the parameters for that page url and page title are passed to the Delicious website rather than just bookmarking out home page.

                          When I tried to use SectionPageName and SectionPageTitle I got the out of context error.

                          Is that any clearer?
                          Regards
                          Sally

                          Fashion Jewellery Wholesale - Glitzy Jewels

                          Comment


                            #14
                            You can do it the easy way and use this code for example - it will include the referring page as part of the script:

                            Code:
                            <a href="http://www.addthis.com/bookmark.php" onclick="addthis_url   = location.href; addthis_title = document.title; return addthis_click(this);" target="_blank"><img src="http://s9.addthis.com/button1-bm.gif" width="125" height="16" border="0" alt="AddThis Social Bookmark Button" /></a><script type="text/javascript">var addthis_pub = 'rawair';</script><script type="text/javascript" src="http://s9.addthis.com/js/widget.php?v=10"></script>

                            Comment

                            Working...
                            X