Announcement

Collapse
No announcement yet.

Inserting HTML into Short Description

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

    Inserting HTML into Short Description

    I have tried using !!< <br> >!! but with no success.

    I am merely trying to force a new line on the title.

    Can anyone advise?

    Thanks

    #2
    as far as i'm aware, its not possible to insert html into the title?

    someone correct me?

    a solution would be to use a pipe: "|" and then use javascript to replace the pipe for a <br>, in script, immidiately after the title.

    Comment


      #3
      do you mean it doesn't work on the product pages or in the cart/checkout?

      It should work on the product pages but I think Gabe is right that it won't work on the cart/checkout pages
      Tracey

      Comment


        #4
        example in case you're a bit of a javascript noob:

        HTML Code:
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
        <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>Spitting a long string with script example</title>
        </head>
        
        <body>
        
        <h2 id="mylongtitle">This is my long title | That I want to split!</h2>
        
        <script>
        var myhtml = document.getElementById('mylongtitle').innerHTML
        document.getElementById('mylongtitle').innerHTML = myhtml.replace("|", "<br>")
        </script>
        
        </body>
        </html>

        Comment


          #5
          Originally posted by budgetbumps
          do you mean it doesn't work on the product pages or in the cart/checkout?

          It should work on the product pages but I think Gabe is right that it won't work on the cart/checkout pages
          For some reaon !!< <br> >!! does not work but !!<<br>>!! does.

          Comment


            #6
            Originally posted by jpn
            For some reaon !!< <br> >!! does not work but !!<<br>>!! does.
            both work for me...but glad you obviously sorted it anyway
            Tracey

            Comment


              #7
              Using HTML in the Product Name will mess up the customer email and the downloaded order.

              I'd do it in a similar way to Gabe's suggestion but in neater way. The following will insert a <br/> wherever ". " (dot followed by a space) is in the product description.

              In your Product Layout, replace
              Code:
              <Actinic:Variable Name="ProductName"/>
              with
              Code:
              <actinic:block php="true">echo str_replace('&#38;#46; ', '.<br/>', '<Actinic:Variable Name="ProductName" selectable="false" />');</actinic:block>
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                lol, norm, you've always got a better way.

                The reason i diddnt use this php method, is speed alone. str_replace is actually not that fast in the embedded php. Not really much to notice actually.

                Comment

                Working...
                X