Announcement

Collapse
No announcement yet.

CR in Short Description

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

    CR in Short Description

    In the Short Description field of a product ....
    I want the short description to be spread over two lines when displayed on screen in the store.
    To achieve this I insert !!<<br />>!! which gives the CR perfectly well.

    However, the <br /> appears in the product line in the Cart, with no CR.
    (see image)

    The lack of a CR in the Cart isn't important, but I'd like to get rid of the <br />.
    Is this possible?
    Attached Files
    Kind Regards
    Sean Williams

    Calamander Ltd

    #2
    I fudged it based on a reply to this problem a while ago by Norman.

    If I want a CRLF in my product description I put a ' - ' i.e. space hyphen space.

    In the layout that displays this I then put

    Code:
     
    <h2><actinic:block php="true">echo str_replace(' - ', '<br/>', '<Actinic:Variable Name="ProductName" selectable="false" />');</actinic:block></h2>
    It then displays as a single line in the cart.

    May be a solution for you?
    Elysium:Online - Official Accredited SellerDeck Partner
    SellerDeck Design, Build, Hosting & Promotion
    Based in rural Northants

    Comment


      #3
      Thanks Goz!
      The theory works a treat.
      However, I'm finding it only works with the alphanumeric charcters (ie; a to z and 0 to 9) - with the rest it simply doesn't work.
      So 'space hyphen space' doesn't work; but, 'space, space, space' DOES work!
      Can anyone shed some light on this?

      As an aside - I'd like to learn what's going on here; can you explain the 'php="true' bit?
      And also, what is operating the 'echo str_replace' - is this a piece of java or
      is it something recognised by the perl processing?

      Showing my true shallow knowledge here
      Kind Regards
      Sean Williams

      Calamander Ltd

      Comment


        #4
        Originally posted by Sean Williams View Post
        can you explain the 'php="true' bit?
        That tells Actinic the next block of code is PHP and should be parsed accordingly. Actinic has it's own inbuilt PHP handling since v8

        Originally posted by Sean Williams View Post
        what is operating the 'echo str_replace'
        Again this is a PHP string function .. which is essentially replacing value "x" with value "y" ... you could use "TTT" as the replace as this is unlikely to be in the text and no messing with spaces .. it could equally be "GOATS"


        Bikster
        SellerDeck Designs and Responsive Themes

        Comment


          #5
          For some hands on tutorials using PHP check out http://www.w3schools.com/PHP/DEfaULT.asP


          Bikster
          SellerDeck Designs and Responsive Themes

          Comment


            #6
            <actinic:block php="true"> tells Actinic to that the code until the </actinic:block> is not text but is PHP code. Actinic has the entire PHP language built-in to do tricky stuff with.

            The code inside is PHP, so look up echo, str_replace, etc in the PHP documentation that's all over the 'net.

            As for space dash space not being recognised that's probably because Actinic has replaced all non alphanumerics with &#nn; type entries. The forum has munged Andrew's post. My original post was OK.

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

            Comment


              #7
              Thanks for taking the trouble guys - this makes everything clear.

              It's such a small thing this, but it's going to make a big difference to us when it comes to neat display of the Short desc. and giving us full info when order processing.

              I've never dabbled in PHP, but I'll take a look at that tutorial.
              Cheers
              Kind Regards
              Sean Williams

              Calamander Ltd

              Comment


                #8
                Sorry Sean.... nearly caused as much confusion as I solved! I should have spotted that &#45 had been replaced in my post.
                Elysium:Online - Official Accredited SellerDeck Partner
                SellerDeck Design, Build, Hosting & Promotion
                Based in rural Northants

                Comment


                  #9
                  slightly off topic I know but a quick question for Norm- Does Actinic work with PHP v5.2+? I'm wondering whether I will be able to utilise the OOP improvements on future projects...
                  The Pretty Dress Company

                  Comment


                    #10
                    Originally posted by Goz View Post
                    Sorry Sean.... nearly caused as much confusion as I solved! I should have spotted that - had been replaced in my post.
                    Thanks Goz but not necessary - it led to me learning more than just the one answer
                    Kind Regards
                    Sean Williams

                    Calamander Ltd

                    Comment


                      #11
                      Originally posted by meden View Post
                      slightly off topic I know but a quick question for Norm- Does Actinic work with PHP v5.2+? I'm wondering whether I will be able to utilise the OOP improvements on future projects...
                      You can put the following into a product description to find out the current version:

                      Code:
                      !!<<actinic:block php="true">phpinfo();</actinic:block>>!!

                      Comment


                        #12
                        Originally posted by meden View Post
                        slightly off topic I know but a quick question for Norm- Does Actinic work with PHP v5.2+? I'm wondering whether I will be able to utilise the OOP improvements on future projects...
                        Actinic V8 uses PHP V4 and Actinic V9 uses PHP V5 locally on your PC. The clue is in the phpnts.dll in the actinic folder where n is 4 for V8 and 5 for V9.

                        Malcolm

                        SellerDeck Accredited Partner,
                        SellerDeck 2016 Extensions, and
                        Custom Packages

                        Comment


                          #13
                          Thanks folks - I guess I didn't really understand how Actinic dealt with PHP or I would've thought of using the phpinfo function.
                          The Pretty Dress Company

                          Comment

                          Working...
                          X