Add an article 'Music' with two divs that should be navigable with an in-page
anchor <div id="video">
and <div="audio">
.
Build a menu hierarchy:
[Music] URL: index.php?option=com_content&view=article&id=6
-- [Videos] URL: index.php?option=com_content&view=article&id=6#videos
-- [Audio]. URL: index.php?option=com_content&view=article&id=6#audio
When selecting one of the submenus [Videos] or [Audio] the browser should
scroll down to the <div>
associated with the menu item.
The top of the page is displayed. The browser does not scroll down.
The cause of the problem is, that two itemIds are added to the link.
The menu link created/enhanced by Joomla looks as follows:
index.php?option=com_content&view=article&id=6&itemId=130#videos&itemId=199
If I manually correct the link and put #videos at the end it works:
index.php?option=com_content&view=article&id=6&itemId=130&itemId=199#videos
Einstellung Wert
PHP erstellt für MacBookPro 19.6.0 Darwin Kernel Version 19.6.0: Tue Jun 21 21:18:39 PDT 2022; root:xnu-6153.141.66~1/RELEASE_X86_64 x86_64
Datenbanktyp mysql
Datenbankversion 10.4.27-MariaDB
Datenbankzeichensatz utf8mb4_general_ci
Datenbankverbindungszeichensatz utf8mb4_general_ci
Datenbankverbindungsverschlüsselung Keine
Datenbankserver unterstützt Verbindungsverschlüsselung Nein
PHP-Version 8.2.0
Webserver Apache/2.4.54 (Unix) OpenSSL/1.1.1s PHP/8.2.0 mod_perl/2.0.12 Perl/v5.34.1
PHP-Interface für den Webserver apache2handler
Joomla-Version Joomla! 5.1.0 Stable [ Kudumisha ] 16-April-2024 16:00 GMT
Joomla Abwärtskompatibilität Plugin Aktiviert ()
Browsererkennung Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Joomla will never create a url like the one you suggest it does as it has two itemid
index.php?option=com_content&view=article&id=6&itemId=130#videos&itemId=199
Sorry this was a typo. The div's on my page are correct, the same as you wrote <div id="audio">
.
Hmm regarding the URL: I suppose the itemId=130 is the top menu (Music) and the itemId=199 is the submenu (Video). When I check the link, there are really two itemId's and unfortunately the second one (199) is behind the #video for some reasons. The two itemId's are added by Joomla (or maybe by a plugin). I guess it is to track the the menu where the page was called from. In the menu is just the URL index.php?option=com_content&view=article&id=6#videos
. From my point of view, the additional itemId's are created by Joomla. I have no idea what else could modify the link...
Sorry!!!!!
You are quite correct - thats a new bug as it should not work like that at all
Thanks a lot for your help! I really do appreciate your work!
In Brian's last post there are 3 links that when clicked on just go to a blank page with "private user image". What is the point if you can't see them?
@gwstyles thats a limitation of the issues.joomla.org site. If you view it on github itself then you ccan see them - which obviously @stonebyter did #43324
Thank you Brian.
There are several things here at play. In this exact case, the solution is indeed to work with the SEF URL. However there is a bug in mod_menu where it should properly parse the URL and then add the Item ID to the query part instead of doing a simple string concatenation. For performance reasons we might want to check for a hash sign before we take the effort of running the URI class.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-09-14 09:16:45 |
Closed_By | ⇒ | Hackwar |
After some more thoughts about this, I've decided that using the SEF URL is the right solution and we won't change this further. Closing this issue. If you think this is in error, please report back here.
This is a good solution, but it works only if you have a flat menu structure I think...
If the link is like https://website/article1 then the resulting link https://website/article1#jump-to-2 works.
But if there are sub-menu items like https://website/products/product1,
it does not work because the resulting link is then like this
https://website/product1#jump-to-3
instead of the correct one
https://website/products/product1#jump-to-3
If I am not missing something, this could be a bug?
Joomla! 5.2.0 Stable
This issue (as stated above) is not solved in Joomla 5.2.1 (and I do not have rights to re-open the issue...)
This is not a joomla bug!!
The problem is that you are not creating the anchors correctly in your content
<div="audio">
is not valid html it must be<div id="audio">