Copy /components/com_newsfeeds/views/newsfeed/tmpl/default.php to /templates/protostar/html/com_newsfeeds/newsfeed/default.php and to
/templates/protostar/html/com_newsfeeds/newsfeed/alt.php
Edit /templates/protostar/html/com_newsfeeds/newsfeed/default.php add "default" just after the first closing PHP tag.
Edit /templates/protostar/html/com_newsfeeds/newsfeed/alt.php add "alt" just after the first closing PHP tag.
Create a newsfeed, and change its layout to "alt"
Create a menu item to a single news feed to display this test.
Overridden alternative layout displayed
Overridden default layout displayed
J3.9, PHP 7.2 FPM, NGINX
It appears that the layout override does work, it just doesn't load anything other than a file named default.php
Labels |
Added:
?
|
No sir. Nothing I've tried loads alt. The reason I added the default test is to show that the override works and which is loaded
I believe overrides only work if the original template exists in the main component directory. Thus is it is not an override but a unique template which will not be overridden by an update so it can go in the normal folder. At least that was what I thought happened.
Menu items are goofy beasts when it comes to alternate layouts in that they define the layout to be used. So you need the appropriate XML file to go along with it if you're trying to do something as a new layout.
OK, I'll look into that. I remember something about XML files in the override document
Labels |
Added:
J3 Issue
|
I've tested this against com_content and I can create any override layout name I desire. It doesn't need to exist in components/com_content/view/article/tmpl in order to be selected and the override to operate as expected.
I have also tested this behavior against com_contact, and it behaves like com_newsfeeds, only default.php is activated as an alternative layout although alternate files are displayed and can be selected.
Status | New | ⇒ | Discussion |
Category | ⇒ | com_newsfeeds |
Labels |
Removed:
J3 Issue
|
Labels |
Added:
J3 Issue
|
Status | Discussion | ⇒ | Information Required |
@stutteringp0et Is this still being experienced in the latest J3 build?
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-08-25 23:41:01 |
Closed_By | ⇒ | Quy | |
Labels |
Added:
No Code Attached Yet
Removed: ? |
If you remove the default.php file does alt then load?