User tests: Successful: Unsuccessful:
Pull Request for Issue Closes #31989
Prepend templatePath with Uri:root to Ensure templatePath is always absolute and not a broken relative url
See #31989
Visit frontend , click a menu link in the left menu to get to an article
Note that the CASSIOPEIA logo (white text on blue background) is present
In Joomla Admin disable the "System - SEF" plugin
Refresh your article page on the frontend
Note the logo is now a broken image
paths are relative, and therefore image doesn't display when non-SEF mode and not at / (ie. in a sub folder or not on the home page where url contains /index.php/path/to like http://127.0.0.1:4444/index.php/component/users/reset?Itemid=101)
regardless of SEF plugin status, the image and assets loaded from $templatePath load correctly.
none
Status | New | ⇒ | Pending |
Category | ⇒ | Front End Templates (site) |
Title |
|
@PhilETaylor Maybe better fix would be change this line of code https://github.com/joomla/joomla-cms/blob/4.0-dev/templates/cassiopeia/index.php#L77 to:
$logo = '<img src="' . Uri::root(true) . '/' . $templatePath . '/images/logo.svg" class="logo d-inline-block" alt="' . $sitename . '">';
That would fix the link to the logo without making other links become absolute.
Tell me what is so wrong with absolute links.
Have you tests with joomla installed in sub folders?
On 20 Mar 2021, at 14:39, Tuan Pham Ngoc @.***> wrote:
@PhilETaylor Maybe better fix would be change this line of code https://github.com/joomla/joomla-cms/blob/4.0-dev/templates/cassiopeia/index.php#L77 to:$logo = '
';
That would fix the link to the logo without making other links become absolute.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Yes, I always use Joomla in sub-folder.
For what's wrong with absolute urls, honestly, I'm unsure. But all the other links if you view sources are relative, not absolute. I remember that I read somewhere that absolute urls will make resources load slower (but I don't know if that's right or wrong)
I have tested this item
Tested successfully in Beta8-dev of 22 March using Wampserver 3.2.4 and PHP 8.0.2.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-03-23 11:36:37 |
Closed_By | ⇒ | PhilETaylor | |
Labels |
Added:
?
|
@SharkyKZ instead of a down thumb would you care to explain why you are not happy with this pull request?