Announcement

Collapse
No announcement yet.

ALT tag missing in carousels

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

    ALT tag missing in carousels

    I use promo carousels quite a lot but they do not define any ALT tags for the search engines. How would I add these, and where? Many thanks.
    Kind Regards
    Karen

    Charmed Cards & Crafts

    #2
    SellerDeck hasn't seen fit to provide any capability for this even though I believe it's been an EU requirement for several years (http://ec.europa.eu/ipg/design/gener....htm#section_5).

    The following assumes you are using Products for the carousels (not Sections or Images).

    Unfortunately there's no simple variable available that can be used in the Carousel layout to put in the product name. All that's available is the Product ID but with a bit of convoluted code this can be used to look up the product name. Try this:
    Go to Design / Library / Layouts / Promotional List Entries / Standard Promotional List Entry.
    Replace all code there with the following:
    Code:
    <div class="Slider">
    <a href="<actinic:variable name="ItemLink" selectable="false" />"><img src="<actinic:variable name="ItemImage" selectable="false" />" alt="<actinic:block type="EntireSectionList"><actinic:block type="SectionEntireProductList"><actinic:block if="%28%3cactinic%3avariable%20name%3d%22ProductType%22%20%2f%3e%20%3d%3d%200%29%0d%26%26%0d%28%3cactinic%3avariable%20name%3d%22ProductID%22%20%2f%3e%20%3d%3d%20preg%5freplace%28%27%2f%5e%2e%2aPRODREF%3d%28%2e%2a%3f%29%26%2e%2a%24%2fi%27,%20%22%241%22,%20%27%3cactinic%3avariable%20name%3d%22ItemLink%22%20%2f%3e%27%29%29" ><actinic:variable name="ProductName"  encoding="strip" selectable="false"/></actinic:block></actinic:block></actinic:block>" /></a></div>
    A note on how it works. All we have available is the link to the product. Luckily this contains the product ID. So some code then has to loop through every Section and Product looking (via some cunning PHP used in a BlockIf) for that ID. If found, it outputs the name of the corresponding product. This takes time to do. If you only have 1 (or a few carousels) this won't impact on site generation times but could slow things down if you have hundreds of carousels.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Intriguing. I didn't even realise you could use PHP in blockifs. When I find some time I'm going to have to look at this in detail and see how it works.

      Mike
      -----------------------------------------

      First Tackle - Fly Fishing and Game Angling

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

      Comment


        #4
        I didn't even realise you could use PHP in blockifs
        BlockIf's are actually evaluated by PHP. That's how all the arithmetic type comparisons are done. Variables are treated as if they have quotes around them so they can be typed in "raw".

        This was a brilliant decision by Actinic (as it was then called). It was done in 2008 when V8 came out. They needed a mechanism to make BlockIf's flexible and embedded the entire PHP language as a solution. This also allowed PHP to be used in constructing the generated pages HTML. Sadly, there have been few major changes since then. We're still stuck with numerous .CAT files and tens of thousands of lines of Perl / JavaScript instead of the long overdue move to an online database and a PHP / mySQL based Search / Filter / Cart / Checkout.

        There's an example in the built-in help under "Using PHP / PHP Within Conditions". It's broken! You don't need the block and /block as BlockIf code is automatically interpreted by PHP.

        There are many limitations. E.g. you can only use PHP's built-in functions and cannot access PHP variables that have been set outside of the BlockIf. Globals are inaccessible too.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Thanks so much Norman. I am pointing to sections though, not to individual products.
          Kind Regards
          Karen

          Charmed Cards & Crafts

          Comment

          Working...
          X