Announcement

Collapse
No announcement yet.

Problem with HTML codes

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

    Problem with HTML codes

    Hi there,
    I have recently started working with actinic and am reasonable familiar with how it all works.
    When i first started work here i noticed that there was a problem with using " to depict inches as it would cut off the alt tags of images etc as the name of the product was not formatted and processed before being dumped into the tags.
    To fix this we converted all the "inces" to the html code &# 34; which corrected the issue i was having. This did however create a new one. In the shopping cart all of the special characters are automatically converted to html codes which displays products like so "1/4&# 34; Hex Nipple".

    My question would be how would i stop this auto conversion from happening?
    http://www.valves-online.co.uk

    #2
    Best undo what you've done as there will probably be repercussions in the downloaded order, customer email, etc.

    A better way would be to fix the alt tag code as follows:
    Code:
          alt="<actinic:block php="true">echo htmlspecialchars('<actinic:variable name="ProductName" encoding="perl" selectable="false" />', ENT_QUOTES);</actinic:block>"
          title="<actinic:block php="true">echo htmlspecialchars('<actinic:variable name="ProductName" encoding="perl" selectable="false" />', ENT_QUOTES);</actinic:block>"
    And you'll get HTML like (product name was Widescreen Multimedia PC 3' 6" <> Screen):
    Code:
          alt="Widescreen Multimedia PC 3& # 039; 6&quot; &lt;&gt; Screen"
          title="Widescreen Multimedia PC 3& # 039; 6&quot; &lt;&gt; Screen"
    UPDATE

    An alternative way of doing this is simply to replace:
    Code:
          alt="<actinic:variable name="ProductName" encoding="strip"/>" />
    With:
    Code:
          alt="<actinic:variable name="ProductName" encoding="actinic"/>" />
    As this replaces all non-alphanumerics with & # nn ; type entries.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Ahh yes very good.
      Unfortunately as we have thousands of products changing it back is a big job as we need to export it replace and re import then check over for duplicates etc...
      My colleague is on holiday for the next few weeks so i will look into implementing that when he gets back.
      Thanks for your help

      Edit:

      just wondering if adding the "strip" encoding to
      HTML Code:
      <Actinic:Variable Name="DuplicateLinkCaption" />
      Would be a temp fix till we can get apply the global update?
      http://www.valves-online.co.uk

      Comment


        #4
        just wondering if adding the "strip" encoding to
        Probably not, as this variable may be interpreted at run-time, not page build time. Try it and see.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          will do an upload tonight and report back tomorrow just in case anyone else has these issues (search results for this application aren't great).
          Thanks for your help
          http://www.valves-online.co.uk

          Comment


            #6
            Don't forget that alt tags are used in other images too. Best Sellers, New Products, Extended Info, Fragments, etc. There's a search facility in the Library so you could hunt for all alt= and title=.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              haha what a mission. You would think they'd of considered people might use inches in their product titles
              http://www.valves-online.co.uk

              Comment


                #8
                FYI it didn't work
                http://www.valves-online.co.uk

                Comment


                  #9
                  Avoiding Special Characters in the First Place

                  I know this is too late to help in this case, but for other readers, I always avoid using any characters that would be a problem in html in the first place. Such as, for inches I would type the word inches or ins, rather than using the quotation mark. In the UK the measurements would need to be in metric anyway, so that problem doesn't arise. I have had problems in the past with words like Jok'N'Al (a name of a brand/supplier), and had to change it to Joknal, which was not too much of a problem. I leave out apostrophes such as Sarah's Butter Fingers, even if Sarahs Butter Fingers is not grammatically correct, and so on.

                  Sarah

                  Comment


                    #10
                    Originally posted by saucysal View Post
                    I know this is too late to help in this case, but for other readers, I always avoid using any characters that would be a problem in html in the first place. Such as, for inches I would type the word inches or ins, rather than using the quotation mark. In the UK the measurements would need to be in metric anyway, so that problem doesn't arise. I have had problems in the past with words like Jok'N'Al (a name of a brand/supplier), and had to change it to Joknal, which was not too much of a problem. I leave out apostrophes such as Sarah's Butter Fingers, even if Sarahs Butter Fingers is not grammatically correct, and so on.

                    Sarah
                    I see where your coming from but having poor grammar or leaving out characters on a shopping site just to prevent a problem that shouldn't exists is never good.
                    http://www.valves-online.co.uk

                    Comment


                      #11
                      Originally posted by jollins View Post
                      i see where your coming from but having poor grammar or leaving out characters on a shopping site just to prevent a problem that shouldn't exists is never good.
                      IRONY ALERT IRONY ALERT IRONY ALERT oh I give up
                      Reusable Snore Earplugs : Sample Earplugs - Wax Earplugs - Women's Earplugs - Children's Earplugs - Music Earplugs - Sleep Masks

                      Comment


                        #12
                        Originally posted by NormanRouxel View Post
                        Best undo what you've done as there will probably be repercussions in the downloaded order, customer email, etc.

                        A better way would be to fix the alt tag code as follows:
                        Code:
                              alt="<actinic:block php="true">echo htmlspecialchars('<actinic:variable name="ProductName" encoding="perl" selectable="false" />', ENT_QUOTES);</actinic:block>"
                              title="<actinic:block php="true">echo htmlspecialchars('<actinic:variable name="ProductName" encoding="perl" selectable="false" />', ENT_QUOTES);</actinic:block>"
                        And you'll get HTML like (product name was Widescreen Multimedia PC 3' 6" <> Screen):
                        Code:
                              alt="Widescreen Multimedia PC 3& # 039; 6&quot; &lt;&gt; Screen"
                              title="Widescreen Multimedia PC 3& # 039; 6&quot; &lt;&gt; Screen"
                        UPDATE

                        An alternative way of doing this is simply to replace:
                        Code:
                              alt="<actinic:variable name="ProductName" encoding="strip"/>" />
                        With:
                        Code:
                              alt="<actinic:variable name="ProductName" encoding="actinic"/>" />
                        As this replaces all non-alphanumerics with & # nn ; type entries.
                        ok been a while but we are trying to implement the changes now.
                        replacing the "srip" with "actinic" didn't work at all. i tried implementing the first suggestion and it does indeed replace the " with a html code but it also adds the actinic custom code tags in too.
                        Code:
                        !!<" ;>!!
                        can we strip them out?

                        EDIT

                        i tried;
                        Code:
                        <actinic:block php="true">
                        $stripquote=htmlspecialchars('<actinic:variable name="ProductName" encoding="perl" selectable="false" />', ENT_QUOTES); 
                        $stripquote=str_replace($stripquote, '!!<' ""); 
                        $stripquote=str_replace($stripquote, '>!!', ""); 
                        echo $stripquote;
                        </actinic:block>
                        no luck. it seems to be adding the garbage after the variable is processed?

                        LAST EDIT

                        managed to get it working with this;
                        Code:
                        <actinic:block php="true">echo htmlspecialchars('<actinic:variable name="ProductName" encoding="actinic" selectable="false" />', ENT_QUOTES); </actinic:block>
                        http://www.valves-online.co.uk

                        Comment

                        Working...
                        X