schreibmawas Posted September 21, 2010 Posted September 21, 2010 Hello! Please tell me where I can remove the title-tags in the whole shop. I mean those e. g. : <img src="123.jpg" title="THIS SHOULD BE REMOVED" /> or in links there are also automatic generated title tags. They pop-up when you move over it. Please tell me where (and when it's too complicated also HOW) I can do that. ;) Many thanks
MrPhil Posted September 21, 2010 Posted September 21, 2010 Note that some browsers (IE6 etc.) will still display a title for images, using the text for the "alt=" attribute, if you give no explicit "title=". Therefore, I have changed titles to "" instead of removing them from <img> tags in the following code. Most of them you could get rid of by changing admin\includes\functions\html_output.php: $image .= ' title=" ' . tep_output_string($alt) . ' "'; to $image .= ' title=""'; and if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "'; to if (tep_not_null($alt)) $image_submit .= ' title=""'; There are more title= scattered throughout the code for images: admin/server_info.php: ' <tr><td><a href="http://www.oscommerce.com"><img border="0" src="images/oscommerce.png" title="' . PROJECT_VERSION . '" /></a><h1 class="p"> ' . PROJECT_VERSION . '</h1></td>' . to ' <tr><td><a href="http://www.oscommerce.com"><img border="0" src="images/oscommerce.png" title="" /></a><h1 class="p"> ' . PROJECT_VERSION . '</h1></td>' . includes/functions/html_output.php: $image .= ' title=" ' . tep_output_string($alt) . ' "'; to $image .= ' title=""'; if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "'; to if (tep_not_null($alt)) $image_submit .= ' title=""'; includes/modules/payment/paypal_express.php: $string = '<a href="' . tep_href_link('ext/modules/payment/paypal/express.php', '', 'SSL') . '"><img src="' . $image . '" border="0" alt="" title="' . tep_output_string_protected(MODULE_PAYMENT_PAYPAL_EXPRESS_TEXT_BUTTON) . '" /></a>'; to $string = '<a href="' . tep_href_link('ext/modules/payment/paypal/express.php', '', 'SSL') . '"><img src="' . $image . '" border="0" alt="" title="" /></a>'; includes/modules/payment/paypal_uk_express.php: $string = '<a href="' . tep_href_link('ext/modules/payment/paypal/express_uk.php', '', 'SSL') . '"><img src="' . $image . '" border="0" alt="" title="' . tep_output_string_protected(MODULE_PAYMENT_PAYPAL_UK_EXPRESS_TEXT_BUTTON) . '" /></a>'; to $string = '<a href="' . tep_href_link('ext/modules/payment/paypal/express_uk.php', '', 'SSL') . '"><img src="' . $image . '" border="0" alt="" title="" /></a>'; install/templates/main_page.php: <a href="index.php"><img src="images/oscommerce_silver-22.jpg" border="0" width="250" height="50" title="osCommerce Online Merchant v2.2" style="margin: 10px 10px 0px 10px;" /></a> to <a href="index.php"><img src="images/oscommerce_silver-22.jpg" border="0" width="250" height="50" title="" style="margin: 10px 10px 0px 10px;" /></a> And some for non-images: includes/classes/split_page_results.php: if ($this->current_page_number > 1) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' "><u>' . PREVNEXT_BUTTON_PREV . '</u></a> '; to includes\classes\split_page_results.php: if ($this->current_page_number > 1) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" class="pageResults"><u>' . PREVNEXT_BUTTON_PREV . '</u></a> '; if ($cur_window_num > 1) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . (($cur_window_num - 1) * $max_page_links), $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>'; to if ($cur_window_num > 1) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . (($cur_window_num - 1) * $max_page_links), $request_type) . '" class="pageResults" >...</a>'; $display_links_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . $jump_to_page, $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' "><u>' . $jump_to_page . '</u></a> '; to $display_links_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . $jump_to_page, $request_type) . '" class="pageResults" ><u>' . $jump_to_page . '</u></a> '; if ($cur_window_num < $max_window_num) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . (($cur_window_num) * $max_page_links + 1), $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a> '; to if ($cur_window_num < $max_window_num) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . (($cur_window_num) * $max_page_links + 1), $request_type) . '" class="pageResults" >...</a> '; if (($this->current_page_number < $this->number_of_pages) && ($this->number_of_pages != 1)) $display_links_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' "><u>' . PREVNEXT_BUTTON_NEXT . '</u></a> '; to if (($this->current_page_number < $this->number_of_pages) && ($this->number_of_pages != 1)) $display_links_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" class="pageResults" ><u>' . PREVNEXT_BUTTON_NEXT . '</u></a> '; includes/functions/general.php: $sort_prefix = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('page', 'info', 'sort')) . 'page=1&sort=' . $colnum . ($sortby == $colnum . 'a' ? 'd' : 'a')) . '" title="' . tep_output_string(TEXT_SORT_PRODUCTS . ($sortby == $colnum . 'd' || substr($sortby, 0, 1) != $colnum ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading) . '" class="productListing-heading">' ; to $sort_prefix = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('page', 'info', 'sort')) . 'page=1&sort=' . $colnum . ($sortby == $colnum . 'a' ? 'd' : 'a')) . '" class="productListing-heading">' ;
schreibmawas Posted September 22, 2010 Author Posted September 22, 2010 THANK YOU SO FAR MrPhil!! I will try it out tomorrow! I only want to get rid of these tags for SEO and smaller file-sizes.
schreibmawas Posted September 22, 2010 Author Posted September 22, 2010 Perfect, I think this really helps!!! One last question: I am a php-newbie. so now I know the locations where I get rid of those title-tags. But what exactly do I have to remove if I want to get rid of the whole title-tag instead of only leaving it empty? --> no title="" anymore anywhere As I am new to PHP I am very careful with deleting codes, so please show an example how I remove this. THANKS U SO MUCH!
MrPhil Posted September 22, 2010 Posted September 22, 2010 Well, because of Microsoft's arrogant bending of the rules, IE6 and earlier browsers (I don't know how IE7 and 8 behave) misuse the alt= text for a pop-up title. That's why you really don't want to remove title="" -- you'll now get a pop-up title over an image. However, if you insist, just remove title="" from all the "after" code lines I gave you (for images). What is the problem with leaving in title=""? Nothing shows when you mouse over the image, it's not that large, compared to the size of the images themselves, and insignificant compared to the rest of the HTML code sent to the browser. And don't forget, SEO is helped by title (and alt) tags -- search engines can't see what's inside pictures, so they use any associated text (alt and title tags) they can find. What are you trying to accomplish?
schreibmawas Posted September 23, 2010 Author Posted September 23, 2010 Well, because of Microsoft's arrogant bending of the rules, IE6 and earlier browsers (I don't know how IE7 and 8 behave) misuse the alt= text for a pop-up title. That's why you really don't want to remove title="" -- you'll now get a pop-up title over an image. However, if you insist, just remove title="" from all the "after" code lines I gave you (for images). What is the problem with leaving in title=""? Nothing shows when you mouse over the image, it's not that large, compared to the size of the images themselves, and insignificant compared to the rest of the HTML code sent to the browser. And don't forget, SEO is helped by title (and alt) tags -- search engines can't see what's inside pictures, so they use any associated text (alt and title tags) they can find. What are you trying to accomplish? Hey, thank u again! I don't want to get rid of ALT-tags. These are necessary but the title tags are not. I don't care what pops up... the robots aren't interested in title-tags. for graphics they only are interested in the alt-tag and the name of the file which should sound almost the same. and inside links title-tags make no sense at all... as you have the link-text... that's why I asked ;-)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.