if I enter index.php?option=com_content&view=article&id=5#section1 into the URL field of my menu > menu item, save it and refresh my homepage,
I will see that joomla changed my URL code changes to http://www.aaa.de/aaa/aaa/index.php?option=com_content&view=article&id=5&Itemid=128#section1&Itemid=120
in the browser.
http://www.aaa.de/aaa/aaa/index.php?option=com_content&view=article&=5&Itemid=120#section1
Joomla 3.9.19
Windows 10
Google Chrome
is seems to be a problem with the ascii code-table for once because I'm getting & instead of &
and secondly joomla adds a second Itemid to the url.
Is it a bug or can it be solved somehow?
Labels |
Added:
?
|
Joomla 3.9.19 & 3.9.20 convert the URL Type string from http://www.aaa.de/aaa/aaa/index.php?option=com_content&view=article&=5&Itemid=120#section1 to http://www.aaa.de/aaa/aaa/index.php?option=com_content&view=article&id=5&Itemid=128#section1&Itemid=120 and that is not only in the source code inspector but also when I hover over the link on my homepage with a mouse.
Why I am using the URL Type? The answer is, to be able to scroll from my submenu link to a specific #anchor in my page. But it doesn't work with the 3.9.19 & 3.9.20 version/
The main issue here seems to be that the fragment #section1
is not at the end of the "converted" URL.
... #section1&Itemid=120
An Example with installed demo data "learning" in Joomla 3.9.21-dev:
URL
with linkindex.php?option=com_content&view=article&id=5#section1
/using-joomla/extensions/plugins/authentication#section1&Itemid=615
#section1
is not at the end.if I enter index.php?option=com_content&view=article&id=5#section1 into the URL field of my menu > menu item, save it and refresh my homepage,
That is your mistake as that is not the url. The url includes the itemid.
Personally I would recommend using the SEF url instead as its much easier.
For example the SEF url is www.example.com/contact
So I make the new menu url /contact#map or www.example.com/contact#map
Works perfectly
Whwn I debug my example item above inside helper.php of mod_menu then I get
[15] => Joomla\CMS\Menu\MenuItem Object
(
[id] => 615
[menutype] => mainmenu
[title] => URLtesten
[alias] => url
[note] =>
[route] => url
[link] => index.php?option=com_content&view=article&id=5#section1
[type] => url
[level] => 1
[language] => *
[browserNav] => 0
[access] => 1
[params:protected] => {"menu-anchor_title":"","menu-anchor_css":"","menu-anchor_rel":"","menu_image":"","menu_image_css":"","menu_text":1,"menu_show":1,"pageheader_suffix_ghsvs":"","page_subheading_ghsvs":"","mega-menu-ul-class":"","mega-menu-li-class":""}
[home] => 0
[img] =>
[template_style_id] => 0
[component_id] => 0
[parent_id] => 1
[component] =>
[tree] => Array
(
[0] => 615
)
[query] => Array
(
[option] => com_content
[view] => article
[id] => 5#section1
)
)
Look at the [query] block. The [id] => 5#section1
looks weird somehow.
it should be
[id] => 5
[anchor] => section1
right?
it should be
[id] => 5
[fragment] => section1
or something like that. I don't know. I always use the recommendation of brianteeman with hidden article menu items if I don't want them in my front end menu.
But the fragment should be kept always at the end of the url if the url is rebuilt; somehow...
It makes no sense at all for you to be trying to build sef urls for this. Just do what I say and use the sefurl in the link
I'll try brianteeman's recommendation with the sefurl.
Closing per #29797 (comment)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-07-17 16:50:28 |
Closed_By | ⇒ | Quy |
Where are you seeing the
&
to&
conversion? This is the expected behavior when viewing the page source/markup.