Announcement

Collapse
No announcement yet.

Displaying a variable image

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

    Displaying a variable image

    Hi Guys,

    as I'm still new to actinic I'm struggling to understand how to go about things, I have signed up Jont to work on the site, but he's busy for another week (and incommunicado) and I really need to get my head around this.

    I want a certain image to show on about half of my product pages.

    do I set up a variable on the product page with a simple yes/no and then use that to display the image
    OR
    do I set up two product pages for the two different options.

    What I don't understand is which way is going to be better for controlling the product page layout and the image position?
    Clothing to make an impression.
    www.stitchfactory.co.uk

    #2
    do I set up a variable on the product page with a simple yes/no and then use that to display the image
    yes.........

    Comment


      #3
      Always better to maintain one layout and switch on and off what you want on there.

      Comment


        #4
        Thanks guys, I'm on with it now!
        Clothing to make an impression.
        www.stitchfactory.co.uk

        Comment


          #5
          Is there a way to set these product variables in bulk or do I have to export to a spreadsheet?
          Clothing to make an impression.
          www.stitchfactory.co.uk

          Comment


            #6
            You have the 'use parent' facility if all the same, otherwise manual or an export.

            Comment


              #7
              Thanks Lee,

              that's worked great. It's my first time using variables and I've managed to get a list with 5 choices in there.
              With your help I've realised I can display it at section level and set most of the section automatically.
              Now I've just got to work out how to show the images with an option. I think that's to do with blocks so I'm now off to digest Gabriels tutorials.

              Actinic! It's getting a little clearer every day!
              Clothing to make an impression.
              www.stitchfactory.co.uk

              Comment


                #8
                What do you mean the images with an option?

                Comment


                  #9
                  Sorry wrong terminology I think.
                  I'm going to display an certain image with a variable setting.

                  I've got a list of 5 variables eg. 1,2,3,4,5
                  If variable is 1 then display image 1
                  etc
                  Clothing to make an impression.
                  www.stitchfactory.co.uk

                  Comment


                    #10
                    Little tip to do that is to have the options in the drop down box, the same name as the image (without the .jpg/.gif) and use the variable name to bring in the image name to use. So you have 5 image names in the drop down list, plus a 'none', if none is selected do not show the image tag, if it is not none, then display the image selected.

                    Comment


                      #11
                      I've got a list of 5 variables eg. 1,2,3,4,5
                      Then a Yes/No type variable as per your initial post may not be the best way to go.

                      Create a variable "PageImage" of type List Of Choices and set your choices to 0,1,2,3,4,5. Name your images image1.jpg, image2,jpg, etc.

                      The simplest way to display the image would be something like: (pseudo code)

                      BlockIf PageImage != "0"
                      <img src="image<actinic:variable name="PageImage" />.jpg>
                      EndIf
                      Norman - www.drillpine.biz
                      Edinburgh, U K / Bitez, Turkey

                      Comment


                        #12
                        I've supprised myself at getting this working.
                        It did involve quite some grey matter to alter Norman's code.
                        It's been 10 years since I last had anything to do with HTML

                        here's the altered code...

                        <actinic:block if=""> <actinic:variable name="LogoIncluded" if="false" />
                        <img src="<actinic:variable name=LogoIncluded />.jpg">
                        </actinic:block>

                        Thanks Lee & Norman, like usual I coudn't have done it without you!

                        One last thing, what do I do for the none option? Do I create a blank image (White Background)?
                        Clothing to make an impression.
                        www.stitchfactory.co.uk

                        Comment


                          #13
                          The none option needs nothing, it is what happens if you don't define an image, or in other words, it doesn't add the img tag as you have not added an image.

                          Comment


                            #14
                            I've ammended the code for the image to be clickable...

                            <actinic:block if="1">
                            <actinic:variable name="LogoIncluded" if="false" />
                            <a href="http://www.stitchfactory.co.uk/acatalog/decoration.html" TARGET="_blank">
                            <img src="<actinic:variable name=LogoIncluded />.jpg" align="right" />
                            </actinic:block>

                            This is leaving me with an empty image tag even though None is selected, as in this link.

                            http://www.stitchfactory.co.uk/acata...-clothing.html

                            I've created a white jpg which would mask the empty tag but it has a red border to show it's clickable. Can I turn this off?
                            Clothing to make an impression.
                            www.stitchfactory.co.uk

                            Comment


                              #15
                              Chris,

                              Your code above has errors in most of the lines.

                              Line 1: blockif that has no variable in the condition so is always true
                              Line 2: variable that will never be displayed (if is always false)
                              Line 3: <a ...> without closing </a>
                              Line 4: no quotes around variable name; missing border="0"

                              Best have a look at the Tutorials before attempting to create your own code.

                              Here's the code to display the image if LogoIncluded is anything other than None. I've left out the link for simplicity (don't forget the </a> tag like in your post above).
                              Code:
                              <actinic:block if="%3cactinic%3avariable%20name%3d%22LogoIncluded%22%20%2f%3e%20%20%21%3d%20%22None%22" >
                              	<img border="0" src="<actinic:variable name="LogoIncluded" />.jpg" />
                              </actinic:block>
                              Norman - www.drillpine.biz
                              Edinburgh, U K / Bitez, Turkey

                              Comment

                              Working...
                              X