Allow JLayout for HTML overrides in com_associations
HTML output here needs to be allowed to be overridden by a template: https://github.com/infograf768/joomla-cms/blob/15a3bb16356d3f62e6a590a996b5bac4d5d3f315/administrator/components/com_associations/helpers/associations.php#L172
Expected result
The HTML is over-rideable with a JLayout
Actual result
It's hardcoded
Additional comments
let's first merge https://github.com/joomla/joomla-cms/pull/14661 as it is just an improvment on the existing. then see how it could be done. not sure i know.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14662.
we already use
return JLayoutHelper::render('joomla.content.associations', $items);
as in other places in core for the same type of display. Do you mean we have to create another type of layout?
The problem is that this JLayout isn't an ideal one. You pass allready generated HTML (the link with a tooltip) and it only creates an list from it.
Ideally you would pass it the needed raw data (url, language) and the JLayout creates the link itself from it.
Also the JHtml::_('bootstrap.popover'); should be in that JLayout.
I don't think it is possible to change it now without breaking anything. Moving the JHtml call should be fine but rest will be tricky.
This is a 3.7 feature. Why can't we do it without breaking things?
is'nt it similar to https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/helpers/html/contentadministrator.php#L32
This is a 3.7 feature. Why can't we do it without breaking things?
The JLayout that is currently used here isn't a new one, it exists since Joomla 3.1 (https://github.com/joomla/joomla-cms/pull/1178). You can't break that one.
We could create a new Jlayout for the association manager that isn't used anywhere else (and put it itno the component folder pretty please) or use the existing JLayout as we currently do and refactor the JLayout in future to make it more flexible.
@infograf768 #14661 is merged.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14662.
@wilsonge are you still looking at applying this to J3 or will this be something in J4?
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14662.
I mean it should be in both versions but I'm not actively working on it. Got too many other things on my plate :(
@wilsonge , just bumping this as a reminder :)
Please tag J4
So, it's been 7 years and I just looked this up... I think this has been fixed in the meantime. Could you check this again, @wilsonge? Maybe we can finally close this?
Still looks like hardcoded bootstrap classes to me https://github.com/joomla/joomla-cms/blob/4.4-dev/administrator/components/com_associations/src/Helper/AssociationsHelper.php#L287
There are lots of hardcoded bootstrap classes in the non-layout files
just search for bg-warning or bg-secondary