6

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. I was only passing the id of the category, instead of an object of that category, that's why I didn't get the field's value. Just for clarity, I post here ...


5

Try this , Normally Joomla provides all major components categories in XML accessible way. For eg: you need banner category dropdown simply use like below. <field name="catid" type="category" extension="com_banners" label="JCATEGORY" multiple="true" size=...


5

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 fields helper $customFieldnames = FieldsHelper::getFields('com_content.article', $article_id, true); // get custom field names by article id ...


4

I would suggest taking a look at http://docs.joomla.org/Creating_a_custom_form_field_type Since it looks like what you are trying to achieve. While the guide may be referring to components this can also work with modules, (I've tried it myself) simply follow the guide but instead of placing your files at /administrator/components/<name of your component&...


4

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/blog/development/203-how-to-add-custom-fields-to-articles-in-joomla You can add a plugin as described here and then, simply via xml add the fields you desire, ...


4

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 good and is, in some ways, a more elegant architecture. DPFields is probably the best option. There is a similar question at... Adding Custom Fields to Article ...


4

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 main tab of your module, even when it's not located inside the <config> tag.


4

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.xml (outside of a <fieldset> is fine): <field name="myNote" type="note" class="alert alert-info" /> In /administrator/com_image/views/...


3

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. The two JQuerys could be causing conflicts. Couple of things to try: Open your console (F12) and reload the page - does it give any js error messages? View ...


3

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 this: I have created a custom field type that overrides the subform field type, specifically overriding the formsource behaviour. The standard subform field ...


3

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->form->getData()->get('filter',array())->myfield1; $MyField2 = $this->form->getData()->get('filter',array())->myfield2;


3

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/fields.php'); //load fields helper $customFieldnames = FieldsHelper::getFields('com_content.article', $artile_id, true); // get custom field names by article id $...


3

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,b.label,b.id'); $query->from($db->qn('#__fields_values','a')); $query->join('INNER', $db->qn('#__fields', 'b') . ' ON ' . $db->qn('a.field_id') . ...


3

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 order you want and they will be displayed in that order in your field group when displayed in your component.


2

It depends on your intention. If you use onContentPrepare to manipulate the markup you need to use the right scope. Your MyPlugin::onContentPrepare will always been fired if the plugin is loaded and a dispatcher triggers "onContentPrepare". But usually you will check against the scope like public function onContentPrepare($context, &$row, &$...


2

In front article edit form there are only selected fields added. If you want to add something there you will have to use Template Overrides to edit this file: /components/com_content/views/form/tmpl/edit.php. This component for now does not load custom form fields automatically like com_content does. Adding field in form.php layout of article view If you ...


2

This article shows you how to do that http://magazine.joomla.org/issues/issue-dec-2014/item/2402-adding-fields-to-com-content-the-smart-way & https://github.com/katalystsol/plg_content_ksextras Basically it involves create a custom cotent plugin that hooks into Joomla's onContentPrepareForm() and onContentPrepareData() methods. here's a copy of the ...


2

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 component config in the backend. Just navigate to the component and click the option button in the toolbar.) How to add / extend component params: https://docs....


2

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 mind that the value is then not prepared. If the onContentPrepare event is fired on the article, then the fields are already attached to the item(article).


2

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

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://joomla.digital-peak.com/products/dpfields


2

I have used Fields Attach on a few projects and it worked well. https://extensions.joomla.org/extension/fieldsattach http://fieldsattach.com


2

Custom field will be supported natively in the upcoming Joomla 3.7. But if you're in hurry, you can try Aixeena Plugin


2

How about to change the $ sign with jQuery? So the code would be jQuery("#tableResizable").colResizable({ fixed:true, liveDrag:true, gripInnerHtml:"<div class='grip'></div>", draggingClass:"dragging" });


2

You can use CSS to hide the field in your form - just check which CSS class (or which id) is assigned to the HTML element that you want to hide (or one of its parents), and then add a CSS rule to hide it (remember, you can select the nth child element of any HTML element through CSS, and then assign the display:none to that element). Having said that, if I ...


2

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" type="list" class="inputbox" label="LIST_FIELD_NAME_LABEL" description="LIST_FIELD_NAME_DESC" ...


2

Basically you have all the custom fields corresponding to the current item accessible via a new property in your $item variable called jcfields. The $item->jcfields property is an array that holds data per field. You could output the fields this way: <?php foreach ($this->item->jcfields as $field) : ?> // Render the field using the fields ...


2

JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php'); $customFields = FieldsHelper::getFields('com_content.article', $articleitem, true); $fields = array(); foreach ($customFields as $field) { $fields[$field->name] = $field->value ? $field->rawvalue : $field->default_value; } Yay!


2

It is very easy to use the custom fields in article-list-view. It works out of the box. You don't have to use JLoader etc. And you don't have to define another "foreach"-argument. Just look, how the "foreach" in default-articles.php for every line in the table is called: <?php foreach ($this->items as $i => $article) : ?> So you only have to ...


2

My solutions to get 2 new columns in my com_content/category/default_articles.php template override. These docs.joomla and the above replies helped me a lot. In the <?php foreach ($this->items as $i => $article) : ?> loop. Where all the item info is collected place: <!-- this code to grab the fields by use of the fieldshelper --> <?...


Only top voted, non community-wiki answers of a minimum length are eligible