? ? Failure

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
17 Jan 2019

This isn't ready to be used yet as it needs some discussion first.

Summary of Changes

All it does is looking in the chrome jlayout folders for XML files and loading them into the module edit form.

Testing Instructions

Create an XML in a chrome folder and put some fields into it. As an example create the file templates/cassiopeia/html/layouts/chromes/params.xml and put the following content into it:

<?xml version="1.0" encoding="utf-8"?>
<form>
	<fields name="params">
		<fieldset
				name="advanced">

			<field
					name="cassiopeia_test"
					type="text"
					label="Test Field Cassiopeia"
					showon="style:Cassiopeia-card"
			/>

		</fieldset>
	</fields>
</form>

Expected result

The defined parameter should be available in the module edit form.
Since the example has a showon defined, it will only show up if you have selected the module style "card" from Cassiopeia.

image

Documentation Changes Required

Obviously.

avatar Bakual Bakual - open - 17 Jan 2019
avatar Bakual Bakual - change - 17 Jan 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Jan 2019
Category Administration com_modules Templates (admin) Layout Libraries Front End Templates (site)
avatar Bakual
Bakual - comment - 17 Jan 2019

@ciar4n mentioned in #23570 (comment) the fact that the way it is done here means template devs need to play nice. The showon would be essential and I also think the prefixed field name.

There are some other thoughts which are needed here. Some that come to mind:

  • What happens if the module style is left on inherited. Currently the custom chrome parameters aren't shown the way the showon is written. Would that be acceptable?
  • What should we do with the existing default chrome fields as defined in https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_modules/forms/advanced.xml
  • Current code enforces no naming convention for the XML. You can have one file per template were you define all params in one place or one file per chrome or even more. Allowing multiple files would allow the user to add more parameters for his own custom chromes.
  • What should happen if we have multiple fields with the same name but different attributes.
avatar ciar4n
ciar4n - comment - 21 Jan 2019

What happens if the module style is left on inherited. Currently the custom chrome parameters aren't shown the way the showon is written. Would that be acceptable?

Tricky. I guess this means that to show the parameters, a user has to select the chrome from the list, even thou the selected chrome is the same as the inherited. Seems incorrect but not sure how to work around it.

avatar Bakual
Bakual - comment - 21 Jan 2019

Seems incorrect but not sure how to work around it.

Yep, I have the same feeling. Imho we can either show all possible parameters, only the default ones or none. We have no way of knowing which is the inherited style, and it may even change when the active template changes.

avatar ciar4n
ciar4n - comment - 22 Jan 2019

Personally, I would lean towards displaying none. Assuming that can be enforced and the template dev can't override it by simply not setting the 'showon'.

avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Apr 2019
Title
RFC [4.0] Parameters for Module Chromes
[4.0] [RFC] Parameters for Module Chromes
avatar franz-wohlkoenig franz-wohlkoenig - edited - 19 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Apr 2019
Title
RFC [4.0] Parameters for Module Chromes
[4.0] [RFC] Parameters for Module Chromes
avatar roland-d
roland-d - comment - 1 Aug 2020

@Bakual Any interest in picking this up and fixing the conflicts?

avatar Bakual
Bakual - comment - 2 Aug 2020

Yep, definitively interested, but certainly not in the comins week or two. Maybe later I can fix it,
Since it's an RFC, I would be interested in more opinions on the matter anyway.

avatar joomla-cms-bot joomla-cms-bot - change - 19 Oct 2020
Category Administration com_modules Templates (admin) Layout Libraries Front End Templates (site) Administration com_modules Layout Front End Templates (site)
avatar joomla-cms-bot joomla-cms-bot - change - 19 Oct 2020
Category Administration com_modules Layout Front End Templates (site) Administration com_modules
avatar Bakual Bakual - change - 19 Oct 2020
The description was changed
avatar Bakual Bakual - edited - 19 Oct 2020
avatar Bakual Bakual - change - 19 Oct 2020
The description was changed
avatar Bakual Bakual - edited - 19 Oct 2020
avatar Bakual Bakual - change - 19 Oct 2020
The description was changed
avatar Bakual Bakual - edited - 19 Oct 2020
avatar Bakual
Bakual - comment - 19 Oct 2020

Fixed the conflicts (they were coming from the now merged other PR). Adjusted the PR description.

avatar punambaravkar punambaravkar - test_item - 7 Nov 2020 - Tested successfully
avatar punambaravkar
punambaravkar - comment - 7 Nov 2020

I have tested this item successfully on 67d4641

Thank you for adding Parameters for Module Chromes


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23577.

avatar priyankaSahutekdi priyankaSahutekdi - test_item - 7 Nov 2020 - Tested successfully
avatar priyankaSahutekdi
priyankaSahutekdi - comment - 7 Nov 2020

I have tested this item successfully on 67d4641


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23577.

avatar HLeithner
HLeithner - comment - 7 Nov 2020

@Bakual can you merge the current 4.1-dev into it and change the target branch because this is a new feature and it's too late for j4.0.

avatar joomla-cms-bot joomla-cms-bot - change - 7 Nov 2020
Category Administration com_modules Unit Tests Administration com_modules com_users Language & Strings Libraries Front End Plugins
avatar Bakual Bakual - change - 7 Nov 2020
Labels Added: ? ?
avatar joomla-cms-bot joomla-cms-bot - change - 7 Nov 2020
Category Administration com_modules Unit Tests com_users Language & Strings Libraries Front End Plugins Unit Tests Repository Administration com_admin SQL Postgresql MS SQL com_associations com_categories com_config
avatar Bakual Bakual - change - 7 Nov 2020
Labels Added: ?
Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 7 Nov 2020
Category Administration Unit Tests Repository com_admin SQL Postgresql MS SQL com_associations com_categories com_config Administration com_modules
avatar Bakual
Bakual - comment - 7 Nov 2020

PR is rebased on 4.1-dev now. Code has not changed.

avatar Bakual Bakual - change - 7 Nov 2020
Title
[4.0] [RFC] Parameters for Module Chromes
[4.1] Parameters for Module Chromes
avatar Bakual Bakual - edited - 7 Nov 2020
avatar bembelimen bembelimen - change - 19 Oct 2021
Labels Added: ?
Removed: ? ? ? ?
avatar Bakual
Bakual - comment - 19 Oct 2021

Removed the use of JForm in favor of Form 😄
Now skipping a template if there is no chrome folder in it (was giving an warning message before)

avatar chmst
chmst - comment - 24 Oct 2021

I like this feature, and it works as described.
As it is a new feature, and documentation is needed, we could do a reordering of the fields, so that it is better understandable?

At least move the field module style at the end, so it is together with newly pluggend in params? @Bakual

avatar Bakual
Bakual - comment - 24 Oct 2021

That's a good idea. I moved the style parameter to the end so it's next to the chrome parameters.

avatar chmst
chmst - comment - 24 Oct 2021

I have tested this item successfully on 7171044


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23577.

avatar chmst chmst - test_item - 24 Oct 2021 - Tested successfully
avatar RickR2H
RickR2H - comment - 24 Oct 2021

I have tested this item successfully on 7171044

Field shows up and works and parameter is stored in the DB.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23577.

avatar RickR2H RickR2H - test_item - 24 Oct 2021 - Tested successfully
avatar RickR2H RickR2H - change - 24 Oct 2021
Status Pending Ready to Commit
avatar RickR2H
RickR2H - comment - 24 Oct 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23577.

avatar bembelimen bembelimen - change - 9 Nov 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-11-09 14:14:58
Closed_By bembelimen
Labels Added: ?
avatar bembelimen bembelimen - close - 9 Nov 2021
avatar bembelimen bembelimen - merge - 9 Nov 2021
avatar bembelimen
bembelimen - comment - 9 Nov 2021

Thx

avatar RickR2H
RickR2H - comment - 11 Feb 2022

@Bakual I just noticed that language strings is the params.xml are not working. In your example you use hard coded language strings. It would be nice if language strings can be added so the parameters become Multilingual. Maybe add a new PR. Ping me if you need someone to test 😉


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23577.

avatar Bakual
Bakual - comment - 11 Feb 2022

Language strings work. I actually just used the feature this week. Did you put the language strings into the templates template_name.sys.ini language file? Because I think only that one is loaded.

avatar RickR2H
RickR2H - comment - 12 Feb 2022

@Bakual Looks like I added the translations to the other file without the sys. Thanks for the tip!

Add a Comment

Login with GitHub to post a comment