User tests: Successful: Unsuccessful:
Pull Request for Issue #14753 .
This PR adds an additional, optional parameter to the field plugin tag: {field ID, LAYOUT}
.
This allows to customize how a field gets rendered when included in the item body.
{field 1, foo}
The field should be shown with your adjusted layout
The standard layout is used always
Don't think there is one.
I've adjusted the plugin description text to include the possible syntaxes.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration Language & Strings Front End Plugins |
Labels |
Added:
?
?
|
Just an idea, would it be hard to adapt the editor button as well to support layouts?
Just an idea, would it be hard to adapt the editor button as well to support layouts?
I thought about it but haven't had the time yet / wasn't bored enough
The hardest thing is to fetch all possible layout for a dropdown (eg like the componentlayouts field). That dropdown could also be used in the plugin parameters to set a "default" layout.
We could also just add a text field. This would be simple, but also not very useful.
The JS part itself isn't that hard, I actually was able to do something similar in my SermonSpeaker component. Given my JS skills, that should tell you how easy it is
I have tested this item
changed in foo.php
<span class="field-value"><?php echo $value; ?></span>
<span class="strong"><?php echo $value; ?></span>
get in Source Code
<dd class="field-entry ">
<span class="field-label">Texttestfoo: </span>
<span class="field-value">alternate-layout</span>
</dd>
So alternate-layout isn't loaded.
In which component did you try this (com_content -> article? or something else?) and what is th path of the foo.php you adjusted?
com_content, path to Template given in Instructions.
Strange
will try again.
I have tested this item
Will it be documented to create the alternative layout /templates/protostar/html/layouts/com_fields/field/foo.php
in the Help page or in the plugin?
I'd expect it to be documented on docs.joomla.org if anything. Certainly not in the plugin.
The override method used here is a common Joomla feature, nothing special at all.
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC after 3 successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-04-12 06:37:06 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
?
|
The plugin description will look like this
For testing, of course also try other combinations?