Announcement

Collapse
No announcement yet.

Inserting icons beneath Short Description

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

    Inserting icons beneath Short Description

    I can't think of a way to do this, but I have a feeling there must be an easy method!
    We want to insert an image beneath the short description - it can be a different image depending on the product.
    The important bit is, it should only be an option / appear on a certain group of products from a certain manufacturer, not all the products on the site.
    Image attached to show what I mean.
    Any pointers gratefully received.
    Attached Files
    Kind Regards
    Sean Williams

    Calamander Ltd

    #2
    There are umpteen ways of doing this.

    The one that might be most usable would be to create a single variable "Options" of type text and also allow it to be empty. Settable at Section and Product level.

    Into that variable you put just one character per option (p=pockets, s=stretch, etc). Several characters are allowed and that's the product associated with several options.

    Then add a bit of code that interrogates this variable, looks for each possible letter in turn and generates an <img .... /> tag for each that's found.

    You can use PHP in the condition. E.g.

    stripos('<actinic:variable name="Options" />', 'p')

    in this case testing for a 'p' (or 'P') as it's case insensitive.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks Guys.
      Both ideas sound good, but I'm afraid you're crediting me with a bit more coding knowledge than I possess

      There are 10 icons, all exactly the same size and format.
      If I was to use BLOCKIF's - what would I perform the test on?

      Norman - by interrogate do you mean using BLOCKIF's as well?

      I'd be very grateful for a little more help with the code I need to put together if you could.
      Kind Regards
      Sean Williams

      Calamander Ltd

      Comment


        #4
        See the Starter Guide for how to create a Variable.

        Here's complete working code that would display pockets.gif and/or stretch.gif depending on what's in a variable called Options.
        Code:
        <actinic:block if="stripos%28%27%3cactinic%3avariable%20name%3d%22Options%22%20encoding%3d%22perl%22%20selectable%3d%22false%22%20%2f%3e%27,%20%27p%27%29">
        	<br/><img src="pockets.gif" />
        </actinic:block>
        
        <actinic:block if="stripos%28%27%3cactinic%3avariable%20name%3d%22Options%22%20encoding%3d%22perl%22%20selectable%3d%22false%22%20%2f%3e%27,%20%27s%27%29">
        	<br/><img src="stretch.gif" />
        </actinic:block>
        Repeat as desired for additional icons.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Thanks Norman - really appreciate that.
          I'm short of time atm, but right after Easter I'll give this a whirl and report back.
          I'm OK on creating Variables, but not quite sure how I'm going to give the Variable "Options" a different value (or empty) on the fly, depending on which product is being displayed. I'll have a dig around.

          BTW Norman - I've used your table code inside the Tabber - it works brilliantly so thanks again for sharing that
          Kind Regards
          Sean Williams

          Calamander Ltd

          Comment


            #6
            Your "Options" variable will appear in the Product Details. Usually under the Properties tab. Just add the characters required on a per-product basis there.

            It may be worth changing the variable in the library so it appears on the General tab as this is where most data entry is done on products.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment

            Working...
            X