May you look something on search engine how about ovveriding module or component.
DIRECT OVERRIDE | FORBIDDEN FROM JOOMLA
My project is somewhat similar to yours in adding custom field from scrath to form. In com_content
, you can follow the step on com_user
.
this is a sample form.xml on my component
<field
name="catid"
type="category"
label="JCATEGORY"
addfieldprefix="TamanLangit\Component\RichContent\Administrator\Field"
required="true"
default=""
/>
The attribut addfieldprefix
is a function to get the I/O value.
In joomla it defaults to "Joomla\Component\Categories\Administrator\Field
".
You can find these functions under adm\com\categories\layouts\form
" or "layouts\joomla\form\field
"
I made a custom layout so my addfieldprefix
value is "TamanLangit\Component\RichContent\Administrator\Field
" whose function can be found in adm\com\richcontent\layouts\form
and the name of the file is on attribut type value="category"
When the addfieldprefix
attribute is set, then joomla will search for type="value"
(value on the the type attribute) in default joomla layout path "layouts\joomla\form\field
"
Disadvantages
all overiding will be gone on update,
so i built my own new component to cover all MVC.
But if you can make all in single layout, the update still cannot prevent this.
Your new layouts will be exist after update.
------------
CUSTOM FIELD JOOMLA TWEAK
Make some CF joomla default and desired value or form from component on adm.
Then login to phpmyadmin at access the CF table. Edit your CF, edit the field context make com_user
.
joomla default is com_content.article
, my project is com_richcontent.article
Then use source from default com_content.article.template
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
on your template registration view.
joomla.edit.params
function can be found in "Layouts\Joomla\edit\params.php"
.
You will see all field function over there.
Disadvantages
- call CF to user view (this is just simple CRUD) but you need solving the where DB Clause condition.
- the nigtmare is update, all overiding to genuine joomla component will be gone.