Default Category Submission

Need help with the Administration of your Joomla! 2.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
mikeh00
Joomla! Intern
Joomla! Intern
Posts: 71
Joined: Fri Sep 02, 2005 3:56 am

Default Category Submission

Post by mikeh00 » Sun Jan 13, 2013 2:39 pm

When I create new categories under the com_content extension, it always sets the default parent at No Parent. How would I set that default parent category to uncategorized when my users create their categories? Some skim right over that part and forget to add a parent (thus leaving it at No Parent), which ends up creating categories at the top level, which ruins some things. Thanks!

mikeh00
Joomla! Intern
Joomla! Intern
Posts: 71
Joined: Fri Sep 02, 2005 3:56 am

Re: Default Category Submission

Post by mikeh00 » Sun Jan 13, 2013 6:09 pm

well I do know the link would be:

index.php?option=com_categories&view=category&layout=edit&extension=com_content&parent_id=2

but I don't know how to get the 'new' button to take me to that link. Any ideas?

User avatar
rcarey
Joomla! Explorer
Joomla! Explorer
Posts: 471
Joined: Sat Apr 25, 2009 9:20 pm
Location: Minnesota (USA)
Contact:

Re: Default Category Submission

Post by rcarey » Tue Jan 15, 2013 5:06 am

My solution is to write a plugin that adds the needed variable (in your case, parent_id=2) and do so only if the JInput variables indicate this is the edit form for a new article category. (I just shared the plugin with you.)

It is tempting to override the edit form and set the default value for this field, but that approach is not as straight-forward as it appears at first. The edit form for creating new categories is re-used for any component that uses Joomla categories - so any one default value is applicable only when the newly created category is for a particular component. ...so in this case I prefer the plugin solution.
Randy Carey -- as of 2023 I'm mostly retired in web development, but still engaged with a few Joomla projects through
Careytech Studios http://careytech.com custom development for tailored or value-added web solutions


Locked

Return to “Administration Joomla! 2.5”