Announcement

Collapse
No announcement yet.

CUSTOMVAR's for Second Image

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

    CUSTOMVAR's for Second Image

    I've been reading the Getting Started Design Guide and have looked at Page 41.
    Using a custom Var to display a second image.

    This works great, but Ive added the variable into a template that is used even for products without the custom property.

    As a result of this I get the missing image placeholder red X.

    Is there a simple way to prevent this from happening?

    I suppose I could always add a single transparent pixel as the alternative image if I don't have a product based one, or use a custom template for the products that are using the custom var.

    But really I was looking for a simpler solution that would only display images if the custom var is specified.

    Any ideas?

    #2
    I think that this has been looked at a number of times before and I think the logical answer was to have a different product template (that includes the netquotevar) for the items that required a second image.
    Football Heaven

    For all kinds of football souvenirs and memorabilia.

    Comment


      #3
      Thanks for the quick reply - I've taken my own suggestion of using s 1x1pixel image at the site level.

      What I've also managed to do is change the code so that the thumbnail open the popup extended image info too based upon the product reference variable.

      Comment


        #4
        Smiffy,

        Good that your sorted, however i'd be tempted to go with George on this one.
        No big debate its just keep your pages simple and only have what you want and avoid redundant imageholder places.

        Just a discipline I suppose.

        I use second images, I even use popups, but not on every page, therefore I have....

        My_Primary_Simple.html
        My_Primary_SecondImg.html
        My_Primary_Popup.html

        Sounds complicated but it very structured when you get into it, you will see the benefits.

        S.
        esafetysigns.co.uk
        your instant download portal for self printable health and safety signs and posters
        ... download once use as many times as you like !


        http://www.esafetysigns.co.uk/index.html
        http://www.esafetysigns.co.uk/acatalog/index.html

        Comment


          #5
          Originally posted by simonwar
          avoid redundant imageholder places.
          Another fantastic capability of v8 to remove such unused code blocks


          Bikster
          SellerDeck Designs and Responsive Themes

          Comment


            #6
            Originally posted by jont
            Another fantastic capability of v8 to remove such unused code blocks
            Good to see the v8 affiliate scheme's still alive and kicking. Great work Jonty.
            Football Heaven

            For all kinds of football souvenirs and memorabilia.

            Comment


              #7
              I handle this sort of problem with javascript. I define a js functions that takes the CUSTOMVAR name as a parameter. The function then spits out the required HTML (if the CUSTOMVAR had a value) or does nothing (if it didn't). That way I keep the same template right across the system.

              Alan Compton
              www.greenknightgames.co.uk
              Great board games and cards games you won't find in the High Street

              Comment


                #8
                Another workaround which I used ages back involves no programming skills at all is to declare 2 CUSTOMVAR's :

                "STARTHIDE" and "CLOSEHIDE"

                you wrap these around the image call eg:

                CUSTOMVAR:STARTHIDE <img src="CUSTOMVAR: SECONDIMAGE" alt="NEQUOTEVAR: PRODUCTTITLE" />CUSTOMVAR:CLOSEHIDE

                In the site options declare

                STARTHIDE = <!--
                CLOSEHIDE = -->

                fantastically Actinic (v7 at least) recognises a space as a custom property so against a product that requires a second image in the properties tag add the 2 rows STARTHIDE and CLOSEHIDE and simply hit the space bar for each value.

                The default is set to comment out the <img> and not display and is the over ridden at the product level by the space effectively allowing the code to be inserted. You can do the same thing with some CSS with display:hidden; to remove the space occupied.

                It's not the cleanest approach (Alan, Norman and Gabriel will kick me for it) but it is simple and it works very easily with no programming skills. Yep - I need to get out more.

                George - you can see why my love for v8's conditions is so strong


                Bikster
                SellerDeck Designs and Responsive Themes

                Comment


                  #9
                  I like it... wish this came up last year?
                  esafetysigns.co.uk
                  your instant download portal for self printable health and safety signs and posters
                  ... download once use as many times as you like !


                  http://www.esafetysigns.co.uk/index.html
                  http://www.esafetysigns.co.uk/acatalog/index.html

                  Comment


                    #10
                    This is one of the beauties of Actinic - you can get it to do some great stuff with a little imagination (and a large pot of coffee)


                    Bikster
                    SellerDeck Designs and Responsive Themes

                    Comment


                      #11
                      and a snapshot.....

                      Comment


                        #12
                        .. and a shot gun for when it gets to 2.30am and it still wont work


                        Bikster
                        SellerDeck Designs and Responsive Themes

                        Comment


                          #13
                          i did this using javascript

                          ## ALL in psudocode, not complete javascript ##

                          1. var thisimageurl = 'CUSTOMVAR:IMAGE2';
                          2. is thisimageurl a blank value?
                          3. write an image if it ISNT: document.write('<img src='.thisimageurl.'>')
                          4. dont write one if it is.

                          Comment


                            #14
                            Originally posted by jont
                            (Alan, Norman and Gabriel will kick me for it)
                            You must have left your boots outside for a change!


                            Bikster
                            SellerDeck Designs and Responsive Themes

                            Comment


                              #15
                              no, actually, you're solution was a valid and clever one. something i'd never thought of.

                              and it wasnt so messy. in fact, i can think of a few uses of that type of enclosure.

                              Comment

                              Working...
                              X