Problem noticed after update to 3.4.0.
<link href="/templates/joomla3templatebybarryflood/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<link href="/templatesjoomla3templatebybarryflood/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
There is no slash after 'templates'.
System operacyjny home.pl Linux x86_64
Wersja bazy danych 5.5.41-37.0-log
Porządek znaków w MySQL utf8_general_ci
Wersja PHP 5.4.37
Serwer WWW IdeaWebServer/v0.80 (like Apache)
PHP działa na ucgi5
Wersja Joomla! Joomla! 3.4.0 Stable [ Ember ] 24-February-2015 23:00 GMT
Wersja platformy Joomla! Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
Klient użytkownika Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.74 Safari/537.36
Fixed by modyfing libraries/joomla/document/html/html.php
commenting line 303
and adding one after, pointing the favicon in images
main folder.
//$href = str_replace('\\', '/', $href);
$href = 'images/favicon_peach.ico';
No extra plugins working.
Labels |
Removed:
?
|
Can you try also with the code of the staging branch? I tried to reproduce your error but everything worked fine with the staging branch!
yeah, staging branch works fine with protostar, can you explain better the error and what template?
Are you using windows?
As a user during error I was using Windows 7 x64, yes.
Now I am not about checking the error out because website is published. I can copy the files to local server and experiment though... I'm certain that pure installation 3.3.6 was OK (favicon replacement in template location worked) and noticed the bug after 3.4.0 update - but not sure if this is the cause.
I was changing nothing else in Joomla itself as far as I remember, just the main template PHP file and styles.
What is staging branch and how do I apply it?
This is template blueprint xml (template itself I've created out of static HTML project):
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.6//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/1.6/template-install.dtd">
<extension version="3" type="template" client="site">
<name>Joomla 3 Template By Barry Flood</name>
<creationDate>22 january 2011</creationDate>
<author>barry flood</author>
<authorEmail>info@barryflood.com</authorEmail>
<authorUrl>http://www.barryflood.com</authorUrl>
<copyright>barry flood</copyright>
<license>barry flood</license>
<version>2.5.0</version>
<description>Base Master Template</description>
<files>
<folder>bat</folder>
<folder>css</folder>
<folder>html</folder>
<folder>images</folder>
<folder>javascript</folder>
<folder>js</folder>
<folder>search</folder>
<filename>index.html</filename>
<filename>index.php</filename>
<filename>templateDetails.xml</filename>
<filename>template_preview.png</filename>
<filename>template_thumbnail.png</filename>
<filename>favicon.ico</filename>
<filename>component.php</filename>
<filename>error.php</filename>
<filename>rollover.js</filename>
</files>
<positions>
<position>navigation</position>
<position>footer</position>
</positions>
</extension>
Labels |
Added:
?
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-11-12 16:18:48 |
Closed_By | ⇒ | brianteeman |
It has been 8 months since this was created. From the information provided it sounds that this is an issue with the specific template and not the Joomla core.
If you are still having this issue it can always be re-opened - please provide the exact code that you are using for the favicon link in your template
Hello, I found this issue is not with the specific template but Joomla core. (Tested on 3.4.5 but newest version 3.4.8 has same code for setting favicon).
What i found is that link is generated wrongly when your JPATH_BASE
constant is set to /
. It happens in function _loadTemplate
(line 590 of libraries/joomla/document/html/html.php
file):
// Try to find a favicon by checking the template and root folder
$icon = '/favicon.ico';
foreach (array($directory, JPATH_BASE) as $dir)
{
if (file_exists($dir . $icon))
{
$path = str_replace(JPATH_BASE, '', $dir);
$path = str_replace('\\', '/', $path);
$this->addFavicon(JUri::base(true) . $path . $icon);
break;
}
}
Part:
$path = str_replace(JPATH_BASE, '', $dir);
When JPATH_BASE
is /
than his line replace all directory separators from $dir
. Thats why link is /templatemy_template
instead of /template/my_template
.
In my opinion the solution is to replace only first occurance of JPATH_BASE
in $dir
string.
I made it by replacing that line with:
$pos = strpos($dir,JPATH_BASE);
if($pos !== false) {
$path = substr_replace($dir,'',$pos,strlen(JPATH_BASE));
}
Hope I hellped.
Sadly, that there is no means to prevent Joomla from generating default ico favicon link. We cannot unset doc->_links, because link as added after template file. We'd like to use favicon generators like:
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="theme-color" content="#ffffff">
But Joomla's last inserted icon will overwrite them for search engines.
@ethernidee commenting on a closed issue will not be seen. Please create a new issue and if necessary add a link to this one
To be precise
The problem affects only favicon
link
, not otherpaths
generated byhead.php
, although it is the only path containingtemplates
part.I guess somewhere is no more
\\
aftertemplates
and thus not changed to/
???Result of head.php before modification as follows
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6606.