Home About Us Developer Blogs Joomla Development Adding Custom Fields to Joomla Categories in Joomla 2.5 and Joomla 3.0
Adding Custom Fields to Joomla Categories in Joomla 2.5 and Joomla 3.0
Wednesday, 17 October 2012 19:43

We recently had a special case scenario where we had to develop a Quick2Cart plugin to sell Joomla Categories.  We were consistently hitting a wall trying to show our custom fieldset for Quick2Cart in the Joomla Category Add/Edit view. We already have a content plugin for this which shows Quick2Cart in Joomla content items.. But it simply wasnt working in case of the category view in Joomla 2.5 as well as Joomla 3.0.

Techjoomla Patch/Hack to Joomla 2.5 to add custom fields to Joomla Categories in Joomla 2.5

After digging around, we discovered that there is bug in Joomla & the code needed to render custom fields is missing in the edit template file.

Here is a patch that will help you add this fix to help you create additional category fields using Plugins..

Open the file /administrator/components/com_categories/views/category/tmpl/edit.php

For Joomla 3.0 look out for the following code change,

Around line 43, look for

 

Just after this line, add the following code for tabs

				form->getFieldsets('attribs'); ?>
					 $fieldSet) : ?>
						
							
  • label);?>
  • Now just after following code,

    loadTemplate('options'); ?>

     

    Add the following code for tab content,

    				form->getFieldsets('attribs'); ?>
    					 $fieldSet) : ?>
    
    description) && trim($fieldSet->description)) : ?>

    escape(JText::_($fieldSet->description));?>

    form->getFieldset($name) as $field) : ?>
    label; ?>
    input; ?>

     

    And for Joomla 2.5 look out for the following code change,

    Around line 89, look for

     

     

    Just above this line, add the following code

     

    		form->getFieldsets('attribs'); ?>
    			 $fieldSet) : ?>
    						
    						label), $name.'-options'); ?>
    						description) && trim($fieldSet->description)) : ?>

    escape(JText::_($fieldSet->description));?>

      form->getFieldset($name) as $field) : ?>
    • label; ?> input; ?>

     

    Thats it ! Your Done ..

    Now your custom plugin to add fields should work just like it will work for other forms like Joomla Content Articles. We hope this blog is useful to any developers who might be stumped !


    blog comments powered by Disqus
     

    Voting Day Holiday !

    We are closed on Thursday April 17th for the Polling Day in Pune, India
    There might be a delay in answering tickets on this account. Any Inconvenience is sincerely regretted.

    We do have a nice 15% discount for you in the meantime !Use the code below to get your discount when you purchase. Offer ends 23: 59 hours April 17th IST. 

    #INDIAVOTES

    Special offer for Responsible Indian Custommers

    If you are an Indian customer & have voted, send us a Pic of your marked finger & get a 30% store wide discount ! Send entries to contact@techjoomla.com 

    Smartphone Applications

    Newsletter Signup

    Jump on to our Newsletter & stay updated on News on our Extensions, New Releases & Offers !