Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,495
    Plugin Contributions
    88

    Default zen_image: Why the extra spaces in the title= attribute?

    Is there a reason why the zen_image function (in /includes/functions/html_output.php) adds a space before and after the alt-text when creating the title= attribute for the <img> tag?
    Code:
        if (zen_not_null($alt)) {
          $image .= ' title=" ' . zen_output_string($alt) . ' "';
        }

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: zen_image: Why the extra spaces in the title= attribute?

    Quote Originally Posted by lat9 View Post
    Is there a reason why the zen_image function (in /includes/functions/html_output.php) adds a space before and after the alt-text when creating the title= attribute for the <img> tag?
    Code:
        if (zen_not_null($alt)) {
          $image .= ' title=" ' . zen_output_string($alt) . ' "';
        }
    Readability?
    Remnants of someone trying to figure out what quotes needed to go where?

    To avoid accidental concatenation of elements? (especially for screen readers)

    Other than these, I can't think of any functional reason for it.

    Cheers
    RodG

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,495
    Plugin Contributions
    88

    Default Re: zen_image: Why the extra spaces in the title= attribute?

    Quote Originally Posted by RodG View Post
    Readability?
    Remnants of someone trying to figure out what quotes needed to go where?

    To avoid accidental concatenation of elements? (especially for screen readers)

    Other than these, I can't think of any functional reason for it.

    Cheers
    RodG
    Exactly!

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: zen_image: Why the extra spaces in the title= attribute?

    Been there since 2004 in v1.1.4 ... maybe was needed way back when and never changed ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,495
    Plugin Contributions
    88

    Default Re: zen_image: Why the extra spaces in the title= attribute?

    Thanks, Ajeh! I'll get them gone ...

  6. #6
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: zen_image: Why the extra spaces in the title= attribute?

    http://www.w3.org/TR/xhtml1/diffs.html#h-4.7

    The user agent spec says they should stripped (although it seems they do not), and Total Validator flags them as an error.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: zen_image: Why the extra spaces in the title= attribute?

    Got bored and hunted through old code ... this was actually inherited from osC a bazillion years ago and never changed ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: zen_image: Why the extra spaces in the title= attribute?

    ZC156: still exists in several places.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  9. #9
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: zen_image: Why the extra spaces in the title= attribute?

    fixed in ZC157. Breathe easy again.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

 

 

Similar Threads

  1. Replies: 3
    Last Post: 3 Oct 2015, 01:42 PM
  2. Where is the file to hard code extra words into title for the category/product pages?
    By skeeterz71 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 23 Mar 2014, 09:32 AM
  3. Blank Page - not the extra spaces issues
    By mochang in forum General Questions
    Replies: 2
    Last Post: 27 Dec 2008, 09:43 PM
  4. Eliminate extra spaces in attribute drop down boxes
    By tqualizer in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 29 Dec 2007, 05:19 PM
  5. Is it possible to show the extra price of the attribute separately?
    By possum in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 14 Nov 2007, 10:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR