Native Protostar template - no frontend article layout overrides:
Load form with <fields name="attribs">
custom fields via onContentPrepareForm
event.
Edit article in frontend, no form fields are displayed
Load form with <fields name="params">
custom fields via onContentPrepareForm
.
Edit article in frontend, form fields are displayed
Fill in fields and save article.
No data is saved.
Custom <fields name="attribs">
are displayed and saved in frontend - same as in backend.
Frontend does not display <fields name="attribs">
but <fields name="params">
which are not saved.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-09-03 14:43:41 |
Closed_By | ⇒ | Denitz |
Why did you close this?
Status | Closed | ⇒ | New |
Closed_Date | 2016-09-03 14:43:41 | ⇒ | |
Closed_By | Denitz | ⇒ |
Sorry, re-opened.
Yes, /components/com_content/view/form/tmpl/edit.php
uses the code:
<?php foreach ($this->form->getFieldsets('params') as $name => $fieldSet) : ?>
So it displays params
fields only, not attribs
. But these params
fields will be not saved since table uses attribs
.
Labels |
Added:
?
|
I can confirm this. Execpt for displaying custom fields, there is also a problem with saving.
Now it is impossible to create a plugin that save custom fields in the parameters for front- and back-end. The only way to do it now is creating a complete new fieldset and let the plugin save data in its own database table.
If you just want to add a simple custom text field this is overkill.
For the back-end you can do something like this:
<fieldset name="params">
<field
name="test"
type="text"
label="Text field"
description="some text field"
/>
</fieldset>
The content of this field will be save inside the params
row of the com_content table. Not sure way, but for the front-end you have to use a fieldset called attribs
.
Note
I try to explain this as good as possible. If it is still not clear I can create a simple plugin to show the problem I have.
Category | ⇒ | Front End |
Status | New | ⇒ | Needs Review |
Labels |
Added:
J3 Issue
|
As the description of the option states that it is only to display them on the admin I am going to close this as expected behaviour and as it is now two years old clearly everyone else thinks it is to be expected.
Status | Needs Review | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-08-18 16:35:55 |
Closed_By | ⇒ | brianteeman |
In other words:
backend displays both
params
andattribs
fields.frontend displays
params
fields only.both frontend and backend save data from
attribs
fields only.