Announcement

Collapse
No announcement yet.

BlockIf's Not Working!?

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

    BlockIf's Not Working!?

    Hi,

    I have never seemed to have problems with block ifs until now,

    Here is a piece of my code -

    Code:
    <actinic:block if="%3cactinic%3avariable%20name%3d%22LightweightIcon%22%20%2f%3e%20%21%3d%20%22%20%22" >
    	<img src="images/lightweight-icon.png" title="Lightweight Product" alt="Lightweight Icon"/>
    </actinic:block>
    Basically, I am trying to hide the image if the LightweightIcon Variable is blank.

    So I tried LightweightIcon == ""

    that didnt work,

    I tried LightweightIcon != ""

    that didn't work either.

    The LigthweightIcon variable for the product is also Blank at the moment too, so I cannot get my head round why it isnt working

    Any ideas?

    #2
    You are saying

    if LightweightIcon != " "

    You have quote space quote. You need quotequote without spaces to test it for not being empty.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Originally posted by NormanRouxel View Post
      You are saying

      if LightweightIcon != " "

      You have quote space quote. You need quotequote without spaces to test it for not being empty.
      No,

      I am saying - LightweightIcon == ""

      &

      LightweightIcon != ""

      which is quotequote together

      Comment


        #4
        You might be saying one thing but your blockif above definitely has a space inside your quotes.

        <actinic:block if="<actinic:variable name="LightweightIcon" /> != " "" >
        Or maybe I've got the quotes all wrong. I always hate the usage of multiple cases of the same type of quote.
        -----------------------------------------

        First Tackle - Fly Fishing and Game Angling

        -----------------------------------------

        Comment


          #5
          Sorry, In the code snippet it may be, but I have tried it both ways. With and without a space in sellerdeck itself, although it doesn't make any difference .

          Comment


            #6
            The example given definitely has a space in between the quotes.
            This is what you should have:
            Code:
            <actinic:block if="%3cactinic%3avariable%20name%3d%22LightweightIcon%22%20%2f%3e%20%21%3d%20%22%22" >
            	<img src="images/lightweight-icon.png" title="Lightweight Product" alt="Lightweight Icon"/>
            </actinic:block>

            Comment


              #7
              Originally posted by Duncan Rounding View Post
              The example given definitely has a space in between the quotes.
              This is what you should have:
              Code:
              <actinic:block if="%3cactinic%3avariable%20name%3d%22LightweightIcon%22%20%2f%3e%20%21%3d%20%22%22" >
              	<img src="images/lightweight-icon.png" title="Lightweight Product" alt="Lightweight Icon"/>
              </actinic:block>
              I have tried it with a space and without a space, it doesn't make a difference for me ?

              Comment


                #8
                You want it without the space. Try putting
                Code:
                1<actinic:variable name="LightweightIcon" />2
                Outside your blockif so you can see what SD thinks is in it. If you see 12 with no spaces then LightweightIcon is definitely null. And double-check by doing a View Source in the browser in case some invisible stuff (like HTML tags, etc) is in your variable.

                Finally, if you see something between the 1 and 2 but no image, you may not be seeing said image because you've got its file-name wrong. Again View Source will help.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  And that images/lightweight-icon.png is rather risky.

                  Much better to keep all files used as part of the design directly in the Site1 (or whatever you've named it) folder. And then use the file-name with no path.

                  Relative path names can lead to problems as SD uploads everything into a single "acatalog" directory on your server.
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment

                  Working...
                  X