1.) Install or start with fresh Joomla 3.3.6 site using the Joomla example data for testing.
2.) In Global configuration disable both SEF and URL rewriting (just for creating readable printurl)
3.) Go to Template manager and make a copy (template style) of Protostar and name it something like Protostar - Red.
4.) Open this Protostar - Red templatestyle, open the Advanced tab and at 'Template Colour' change the colour to a red colour. Save the template style.
5. In Top menu create a new menu-item 'Test-blue', menu-item type is single article and point the menu-item to the article 'Joomla Testing'. For template style choose 'Use Default' (Protostar)
6.) In Top menu create a new menu-item 'Test-red', menu-item type is single article and point the menu-item to the same article 'Joomla Testing'. For template style choose 'Protostar - Red'.
7.) Reload front-end. New menu-items will be visible in top menu.
8.) Click the Test-blue menu-item. Joomla Testing page (Yes it's the homepage), choose the Print menu-item in the little dropdownmenu, and component.php will load, presenting only the component with the correct blue style.
9.) Now on the front-end click the 'Test-red' menu-item. Same page but in red colours. Choose again Print. You should expect the component in red colours, but no: they are blue!!!
When you compare in both pages the Itemid in the print-url with the one of the current page, you will see that in both cases the Itemid's are NOT the same. In my setup the Test-red page has Itemid: 480, and Test-blue has Itemid: 481. But the item-id in the print-url is 435. This is the Itemid from de Home menu-item in 'Main menu'.
In this example I used the homepage article, but I discovered this bug on a website with 5 different template styles, using complete different content. What I found out is that the print-url in all cases gets the lowest Itemid of the menu-item pointing to this article. So the print-url is NOT based on the ItemID of the current page. As long you only use one default templatestyle, there is no problem, but with more menu-items using different templatestyles pointing to same article we get this wrong templatestyle for printing.
Of course the print-url should use the same Item-Id as the current page, using the same template-style for printing.
Happens on different online hosts and also on localhost.
Labels |
Added:
?
|
confirmed
Status | New | ⇒ | Confirmed |
Build | 3.3.6 | ⇒ | 3.4.1 |
Found out that this wrong Itemid problem not only exist in the print link, but also in the submitted link when using the 'Email this link to a friend.' form.
Here wrong/different itemid is not a problem. The component template of protostar theme doesn't have code to apply different template colour other than default. #justanobservation
This is not only a wrong colour issue with the protostar template. The problem is much deeper in the routeing logic of Joomla! Every different template with multiple templatestyles will get this problem. Also the 'sending a link to a friend' feature will send the wrong url, with wrong Itemid. And even languages and modules can get trouble with this, because they all depends on Item-ids
Category | Front End Templates (site) | ⇒ | Front End Router / SEF Templates (site) |
The key to this issue is
What I found out is that the print-url in all cases gets the lowest Itemid of the menu-item pointing to this article.
Its another case of where we have an issue when there are multiple menu items pointing to the same content
Hi @Klipper! You created this issue sometime ago but have not provided any code for people to evaluate. As no one else has shown any interest in providing the code and you have not then I am closing this issue at this time. If code is provided (a pull request) it can always be re-examined.
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-08 16:20:10 |
Closed_By | ⇒ | Kubik-Rubik |
This issue is still present in Joomla 3.4.2.current staging
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5893.