8
votes
Accepted
Getting custom fields and their values (com_fields)
The key here (which I misunderstood/overlooked) is that for the FieldsHelper::getFields method, to also return the value & rawvalue of the custom fields, the $item has to be a content item object. ...
5
votes
Getting custom fields and their values (com_fields)
For getting custom fields and values for Joomla articles, you can use the following code:
<?php
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/...
5
votes
Accepted
How to fetch joomla article custom fields in another component?
You can use the following code to fetch custom field values by article id
<?php
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php'); //load ...
5
votes
Accepted
How to generate a dynamic note field for a custom component?
Use Form::setFieldAttribute(). Typically, this is done in the model's getForm() method. However, if it's cosmetic only, it can be done in the view too.
In /administrator/com_image/models/forms/image....
4
votes
Accepted
How to remove the default editor inserted in a custom module
Please check if your custom module XML file contains the following line:
<customContent />
This line is present in the default Joomla Custom HTML module, and inserts an editor field in the ...
4
votes
Accepted
Adding custom fields to com_content category
Yes, you can add custom fields to the com_content (category? I assume you intend component?):
https://docs.joomla.org/Adding_custom_fields_to_core_components_using_a_plugin
https://zunostudios.com/...
4
votes
Joomla Custom Fields Module / Matrix
There are a few options for this, the two best are probably FieldsAttatch and DPFields.
I've used FieldsAttatch for a few years, and it has a nice light approach. However the newer DPFields looks ...
4
votes
How to fetch joomla article custom fields in another component?
This function will allow display of JCFields anywhere in any extension desired, including templates.
The first parameter is the only requirement and will dump the JCF data, based on the item ID ...
4
votes
Accepted
How to show list of articles filtered by category and custom field
You can filter on Custom Fields via multiple ways:
filtering via JavaScript + CSS. This will load all articles, but can CSS hide (display:none) them using some JavaScript. The articles are still ...
3
votes
Custom 'dynamic' form field creation
I am using the following to achieve something similar to what you need BUT in a plugin. Need to confirm if it is also valid to component.
<field
name="list_field_name"
...
3
votes
Accepted
Dynamic fields in module parameters
No answers here, but I have managed to work it out for myself. The answer is actually to use both of the solutions I had in mind already -- a custom field type and a subform.
My solution works like ...
3
votes
Accepted
Customize Global Configuration
First: Use a current Joomla. Your 1.5 site will be hacked in no time.
Second - the answer (Joomla 2.x - 3.x):
You can add component params to the component configuration. (You can access the ...
3
votes
Accepted
Custom field colResizable plugin not working but works in fiddle
You are calling the colResizable jQuery plugin before the jQuery itself. It should be the other way round.
Also, Joomla's admin should also already have jQuery loaded, but that uses jQuery v1.12.4. ...
3
votes
How to retrieve active filter from a custom field form?
Thank God for 5 year old posts and Occam's Razor. The Custom Field has direct access to the form that I was trying to get to!!!! No need to load a model, helper, or otherwise.
$MyField1 = $this->...
3
votes
Accepted
Custom Fields inside module override
The label is in the 'fields' table so you could pull them with the values in a single query by using a join, eg.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('a.value,...
3
votes
Accepted
Joomla 4 - how to set namespace for custom field addfieldprefix
To implement Joomla standard namespacing in a plugin, follow these steps:
First, declare extension's namespace in manifest file:
<namespace>Joomla\Plugin\EditorsXtd\Vimeo</namespace>
If ...
3
votes
Accepted
How to change custom field order in field group?
The order of the fields in the field group is determined by the order the fields appear in the fields page. You can therefore use the up/down arrows on the left to drag and drop the fields in the ...
3
votes
Accepted
How to programmatically set the value of a custom field of type checkbox?
Basically you needed to use onContentAfterSave rather then onContentBeforeSave and use the FieldsHelper in conjuction with the FieldsModelField.
Here is the code:
<?php
defined( '_JEXEC' ) or die(...
3
votes
Accepted
How can I create my own custom field?
I think you might be right there aren't direct official tutorials on this. But in the Joomla! documentation there is a hint.
A developer focused pdf from the creator of custom fields Allon Moritz ...
3
votes
Layout override for repeatable subform custom field
This helped me to solve my problem...
<?php $fieldX = json_decode($this->item->jcfields[X]->rawvalue, true); ?>
where X is the Id of the subform native field
A, B, C is the respective ...
3
votes
Accepted
Creating a field plug-in, need the com_content form to be enctype multipart
There really isn't a good way to do this. Your best bet is parsing the already generated HTML and making a replacement there. For the component this can be done using onAfterDispatch event. Below is a ...
3
votes
Accepted
J4 - Custom Profile Plugin - Hiding Groups
I don't think it's safe to remove field groups based on fieldset names. They are unrelated and could be named differently, leading to unexpected results. And that is exactly the issue you're running ...
3
votes
Accepted
Dynamically add option to Jform field
You're already aware of Joomla\CMS\Form\Field\ListField::addOption() method. value is an attribute in the XML so it needs to be passed along with other attributes in the second argument:
$this->...
3
votes
Accepted
How to get an article id in blog category view inside fields plugin
Field value is rendered during onCustomFieldsPrepareField event which takes 3 arguments: the context string, content item object and the field object. The content item is the second argument passed to ...
2
votes
Accepted
DPFields display values in module
Glad you like it. If you just need the value, then use the field model as you can see here https://github.com/Digital-Peak/DPFields/blob/master/com_dpfields/admin/helpers/dpfields.php#L137. Keep in ...
2
votes
Custom field colResizable plugin not working but works in fiddle
How about to change the $ sign with jQuery?
So the code would be
jQuery("#tableResizable").colResizable({
fixed:true,
liveDrag:true,
gripInnerHtml:"<div class='grip'>&...
2
votes
Custom Fields in component Articles - Joomla 3.6.4
Try Joomla 3.7.*, custom fields option is included in it.
Read article for help
https://www.joomshaper.com/blog/how-to-use-joomla-3-7-custom-fields
2
votes
Custom Fields in component Articles - Joomla 3.6.4
You might want to try digital peaks' dpfields. This is the extension where the 3.7 custom fields are based on. It will probably be possible to migrate from dpfields to j3.7! core custom fields.
https:/...
2
votes
Custom Fields in component Articles - Joomla 3.6.4
I have used Fields Attach on a few projects and it worked well.
https://extensions.joomla.org/extension/fieldsattach
http://fieldsattach.com
2
votes
Custom Fields in component Articles - Joomla 3.6.4
Custom field will be supported natively in the upcoming Joomla 3.7.
But if you're in hurry, you can try Aixeena Plugin
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
custom-field × 197joomla-3.x × 57
joomla-4.x × 27
plugin × 20
form-fields-types × 20
fields × 19
articles × 18
custom-component × 13
jform × 13
php × 12
module × 12
xml × 9
joomla-4 × 9
template-override × 8
joomla-3.7 × 8
subform × 8
com-fields × 7
development × 6
user × 6
com-content × 6
joomla-3.9 × 6
repeatable-field × 6
component × 5
mysql × 5
administrator × 5