Announcement

Collapse
No announcement yet.

HTML code shows using AUG 10 words or lest Discription edit

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

    HTML code shows using AUG 10 words or lest Discription edit

    Hi,

    Followed the tutorial in AUG to get 10 words or less in the mini marketing boxes, works a treat. But, in a lot of my layouts in Product Description I have used the older markups from V6 (which work fine on the actual product pages etc) of :

    Code:
    !!<<font color=YELLOW>xxxx xxxx</font>>!!
    But the text shown in the mini marketing front pages, sidebar and the Also Bought Products Mini layout actually shows the code as well as coloring the text?

    Is there a way around this do you know?

    Thanks

    B
    Organic Image - Award-winning Airbrush Kustom Art & Airbrush Classes

    #2
    We abbreviate the full product description in the mini marketing lists using javascript on the client side. This gets around your problem as it reads in the full description in proper HTML format and then truncates it. Sometimes it isn't perfect as it works on individual charcters so the description can get truncated in an odd place, but it generally works quite well:

    Code:
    <script type="text/javascript">
    var prodstr=ProductDescription.substring(0,400);
    var mystr=prodstr.substring(0,prodstr.lastIndexOf("/>"));
    document.write(mystr+"/>");
    </script>
    where "ProductDescription" is the Actinic variable for the full description (I'm not at my Actinic PC and I can't remember exactly what the variable is called!!). Put this into your mini marketing layout in place of the full description and try it out. We've set it up to take the first 400 characters of the full descrition and then look for the last closing tag within that list (it's usually a <br/> or similar representing a suitable end of line to truncate to).
    ActiveStock
    On-line, real-time stock control plug-in for Actinic V7, V8 and V9
    **New - Captcha plug-in for your Contact Us form**

    ActiveStock website
    Free 30 Day Trial
    ActiveStock Blog (including a new tutorial on a 'Sort By' function for long section pages)

    Comment


      #3
      the easiest way round it is to avoid using html markers in the first 10 words of your marketting products descriptions, tbh.
      I don't recall that there has been a proper solution shared (yet!)

      [editted to remove a bit that was incorrect in the first place]
      Tracey

      Comment


        #4
        LOL..there ya go, see!
        NOW someone has shared it!
        Nice one, Richard!
        Tracey

        Comment


          #5
          Originally posted by rmorrow View Post
          We abbreviate the full product description in the mini marketing lists using javascript on the client side. This gets around your problem as it reads in the full description in proper HTML format and then truncates it. Sometimes it isn't perfect as it works on individual charcters so the description can get truncated in an odd place, but it generally works quite well:

          Code:
          <script type="text/javascript">
          var prodstr=ProductDescription.substring(0,400);
          var mystr=prodstr.substring(0,prodstr.lastIndexOf("/>"));
          document.write(mystr+"/>");
          </script>
          where "ProductDescription" is the Actinic variable for the full description (I'm not at my Actinic PC and I can't remember exactly what the variable is called!!). Put this into your mini marketing layout in place of the full description and try it out. We've set it up to take the first 400 characters of the full descrition and then look for the last closing tag within that list (it's usually a <br/> or similar representing a suitable end of line to truncate to).

          Hi bud,

          Could you just be a bit more specific where that goes? At the mo I have this to get the 10 words or less:

          Code:
          <p class="text_product_small_info"><!--<actinic:variable name="ProductDescription" />--><actinic:block php="true" >
          $sShort = "";
          $nCount = 0;
          $sOriginal = '<actinic:variable encoding="perl" name="ProductDescription" selectable="false" />'; 
          foreach(explode(" ", $sOriginal) as $sWord)
          	{
             if ($nCount > 10)
             	{
             	$sShort .= "...";
             	break;
             	}
             $sShort .= $sWord . " ";
             $nCount++;
             }
          echo $sShort;
          </actinic:block>
          I've commented out the original Description and added the AUG stuff.

          Thanks

          B
          Organic Image - Award-winning Airbrush Kustom Art & Airbrush Classes

          Comment


            #6
            Hi Brian

            If you want to use my javascript code, you should completely remove the php block (although save it somewhere handly in case you want to go back to it!!). So you should end up with:
            Code:
            <p class="text_product_small_info"><!--<actinic:variable name="ProductDescription" />-->
            <script type="text/javascript">
            var prodstr=ProductDescription.substring(0,400);
            var mystr=prodstr.substring(0,prodstr.lastIndexOf("/>"));
            document.write(mystr+"/>");
            </script>
            ActiveStock
            On-line, real-time stock control plug-in for Actinic V7, V8 and V9
            **New - Captcha plug-in for your Contact Us form**

            ActiveStock website
            Free 30 Day Trial
            ActiveStock Blog (including a new tutorial on a 'Sort By' function for long section pages)

            Comment


              #7
              Thank you Is this something that will only work when the site is uploaded? I am still using the evaluation copy until next week when I get the license and I haven't gone as far as an upload just yet.

              Cheers

              PS: I notice too that the mini product layouts on the MAIN page section (right column product areas etc) the text flows 'right' around the image nicely but in the left-hand column, the text for the DESCRIPTION is a good 2 P tags below and I simply can't edit the code to get the text to from the DESCRIPTION to wrap right against the image? Is this because the css for the left column effects the added content?

              cheers . .

              Brian
              Organic Image - Award-winning Airbrush Kustom Art & Airbrush Classes

              Comment


                #8
                Also . . after adding this code as you stated, I get an error:

                Javascript error has been found on the page ('ProductDescription' is undefined')

                Just thought I'd mention that

                Brian
                Organic Image - Award-winning Airbrush Kustom Art & Airbrush Classes

                Comment


                  #9
                  Originally posted by BrianCurtis View Post
                  Javascript error has been found on the page ('ProductDescription' is undefined')
                  Yes, the 'ProductDescription' needs to be the Actinic variable, so either pick it from the variable list or write it out in full as <actinic:variable name="ProductDescription" />

                  It should work in the Preview pane without having to do an upload.
                  ActiveStock
                  On-line, real-time stock control plug-in for Actinic V7, V8 and V9
                  **New - Captcha plug-in for your Contact Us form**

                  ActiveStock website
                  Free 30 Day Trial
                  ActiveStock Blog (including a new tutorial on a 'Sort By' function for long section pages)

                  Comment

                  Working...
                  X