Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 2109

General Questions/New to Joomla! 4.x • Re: How to use component layouts and support overrides

$
0
0
Assuming the name of your component is com_mycomponent, to display a layout from /components/com_mycomponent/layouts/something/displaysomething.php, use the following:

Code:

$displayData = []$layout = new FileLayout('something', null, array('component' => 'com_mycomponent'));echo $layout->sublayout('displaysomething', $displayData);
To override the file in your template, copy it to your template directory html/layouts/com_mycomponent/something/displaysomething.php or you can use the Create Overrides feature in the admin.

Statistics: Posted by pinkshirt — Thu Feb 01, 2024 12:43 am



Viewing all articles
Browse latest Browse all 2109

Trending Articles