Print
Category: Article Details

Layout overrides

Information
Article Details

Profiles

Since v5.0, all article details are shown through layouts, allowing template overrides.

You can find the original layouts under components/com_articledetailsprofiles/layouts.

As best practice, it is recommended to create overrides of those files rather than update them. That way, the next component update won't dismiss the changes you have made.

Note that the overrides have precedence over the component's layouts.

The layouts are available from your template's Create Overrides tab, under the layouts section.

The layouts ready for override
The layouts ready for override

Once clicked, all the layouts are copied over to the template's /html/layouts folder (Editor tab).

The created layouts overrides
The created layouts overrides

Available layouts

The file names follow the convention: adp_detail_[information type].php

In Joomla 3.7+, the custom fields use the generic layout (adp_detail_jfield_generic.php), unless a specific layout is present.

v5.2
The adp_detail_share layout now calls sub-layouts for all share buttons.
When creating a new share button, you need to add a new sub-layout to the /html/layouts/com_articledetailsprofiles /details/adp_detail_share folder (you may need to create those folders) of your template. To know what the sub-layout's code must be, just copy one of the extension's available sub-layouts.

Tutorial Learn how you can add a custom social network share button

Tip When clicking on the Details folder, all layouts are copied over to the [current_template]/html/layouts/com_articledetailsprofiles template folder. This happens even if you just want to only change one layout. Only keep the layouts overrides that need modifications. Delete all other layouts. This will help you down the road for maintenance (you will know that the files present have been modified for sure).

v5.3

The layout suffix

You can use different overrides of the same layout for plugin syntax or module instances. Just set the advanced parameter Layout suffix. By doing so, you are giving priority to the layouts that will contain that suffix in the name of the override.

For instance, you can override adp_detail_jfield_generic.php but also have a module instance use a slightly different output. Just add the layout suffix (for example 'xyz') to the module instance and that instance will give priority to the override adp_detail_jfield_generic.xyz.php.