Announcement

Collapse
No announcement yet.

trying to get an image variable to display/not display

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

    trying to get an image variable to display/not display

    I've managed to get a small .gif image to display in my product layout by creating a variable whose Type is Filename - but am stuck with how you go about getting it to display (and not display). When selected in the General tab of my product details it offers me the browse option of my Site folder - instead of the display or not display (my image) that I require.

    Using 'List of Choices' I created a blank image as a 2nd choice but I'm sure there is probably a better way to enable a choice of displaying/or not the image variable.

    The odd recent thread I found didn't lead me to a solution, I realise it's basic stuff but it's new ground for me Any help much apreciated.

    Sean

    #2
    Set it to show if it is not empty, so if there is something in it, then show it, if not then don't. No need for a list or a true/false etc. simply use whether it has something in it or not as the trigger to show or not. 'Is not empty' is part of the condition builder, use that as part of a blockif around the code bringing in the image.

    Comment


      #3
      Sorted

      thanks Lee, I just wrapped my first condition (after a few botches) and it worked! Nice one. I can now display this gif image in any of my products.

      I had hoped also to be able to have this image display en mass for all products within a Section of my choice - but it's not yet working this way, only at product level - I've got Section selected in the Place of Setting options but this didn't equate to all products within a section displaying the variable image. Am I overlooking/leaving something out possibly?

      thanks. Sean

      Comment


        #4
        You need to have the 'use parent' facility enabled and set up on the variable (right at the bottom of the setup variable screen). You then set the image at section level and it will cascade down through all sub sections and products underneath that level.

        Comment


          #5
          thanks again - got it going after a bit of muddling - i'm turning a corner (after 6 months use!) now and I can see the hierarchy of the setupmore clearly, great to get good advice of course, cheers Lee.

          Comment


            #6
            Has anyone got hte code that would be inserted into the layout to show an image that is being called by a variable.
            The variable name i have used is Image2

            I have tried a few ways and had a look in the forum but can't seem to get it figured out.
            any help appreciated.
            thanks, Mark.
            Log Cabins and Garden Sheds
            Decking, Fencing, Gates and Spiral Stairs

            Comment


              #7
              Code:
              <actinic:block if="%3cactinic%3avariable%20name%3d%22Image2%22%20%2f%3e%20%21%3d%20%22%22">
              	<img src="<actinic:variable name="Image2" />" />
              </actinic:block>
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Thanks Norman
                Log Cabins and Garden Sheds
                Decking, Fencing, Gates and Spiral Stairs

                Comment


                  #9
                  sorry to be a pain, however every time i enter the actinic:variable part as soon as i press space it deletes it, i have tried it in other places in the code an di does the same. I am using V9 any ideas why?????????
                  Log Cabins and Garden Sheds
                  Decking, Fencing, Gates and Spiral Stairs

                  Comment


                    #10
                    Make sure you have a variable already created called 'Image2' to hold the image filename then just cut and paste Norman's code into the layout.

                    Comment


                      #11
                      Tried pasting it and it deletes the same oarts every time.
                      I have decalred a variable Image2 in the product section of the library, i have tried it as Filename and File content.
                      All i get left with when i paste is
                      Code:
                      <actinic:block if="<actinic:variable name="Image2" /> != """>
                      	<img src="Image2" />
                      </actinic:block>
                      Now I am really confused as this is not what is showing on my screen in Actinic when i highlighted it.

                      What is showing on my screen is
                      block if != """>
                      <img src="Image2" />
                      /block
                      getting way to confusing ow
                      Log Cabins and Garden Sheds
                      Decking, Fencing, Gates and Spiral Stairs

                      Comment


                        #12
                        Image2 should be of type File Name.

                        The forum munged my post #7 and I've now re-done it. Try using it now.

                        Actinic can show design code in a compact colour highlighted way or the full underlying code. Click the [><] icon in the top left of any layout code window to toggle between them. Icon has orange border if compact and no border if full.
                        Norman - www.drillpine.biz
                        Edinburgh, U K / Bitez, Turkey

                        Comment


                          #13
                          There are tutorials regarding the design and the Library in the Starter Guide - complete with exercises. Best try mastering some of these and you'll be better prepared for future tinkering.
                          Norman - www.drillpine.biz
                          Edinburgh, U K / Bitez, Turkey

                          Comment


                            #14
                            Excellent, thanks for your help again.
                            It is working now.
                            Log Cabins and Garden Sheds
                            Decking, Fencing, Gates and Spiral Stairs

                            Comment


                              #15
                              OK sort of the right thread

                              I am working with some variables to allow selecting different images from within the product, the customer clicks view more images and these are displayed using grey box but im having a problem with the image url's

                              When i upload to test it, the correct image url is not shown just the image.

                              I have this code
                              Code:
                              <script>
                              var image_set = [
                                  {'caption': '<actinic:variable name="Grey Box Image 1Title" />', 'url': '<actinic:variable name="Grey Box Image 1" />'},
                                  {'caption': '<actinic:variable name="Grey Box Image 2Title" />', 'url': '<actinic:variable name="Grey Box Image 2" />'},
                                  {'caption': '<actinic:variable name="Grey Box Image 3Title" />', 'url': '<actinic:variable name="Grey Box Image 3" />'}
                              ];
                              </script>
                              <a href="#" onclick="return GB_showImageSet(image_set, 1)"> More Images</a>
                              which i had thought actinic would upload the correct url for the image as
                              /acatalog/image.png
                              but it uploads the image url as
                              image.png

                              i have tried adding /acatalog/ before the variable but that just results in the variable not being actioned.

                              Any help or pointers in this area would be appreciated

                              Darren

                              Comment

                              Working...
                              X