3

Is there any way you know of to add a custom/extra field to just a single category and not all articles as described here, without using an extension like k2?

1

While it may not be what you're looking for, you could use the Fields Attach component. It's not a CCK like K2, it extends the built in articles and gives you custom fields. It supports having the fields appear only in the editor for articles in certain categories, which is what you're trying to do.

http://www.fieldsattach.com

1

Without spending much thought on your requirement, I can't imagine an easy workable custom solution to your problem. Thinking that you are going to need a way to manage the extra field(s), and also a way to check for the categories (probably with a plugin (??))..

But unless you want to get your hands dirty with code, why to re-invent the wheel?

Since someone else have considered and provided a solution for this kind of problem, I think that this is the case where is better to consider a 3rd party extension, which will provide you with what you need.

Fields Attach comes really handy in your particular situation. It will let you extend Joomla's core content, with your desire custom fields. It provides most of the common field-types and you can create fields-groups and assign them only to specific categories.

Of course, you can also try with other CCK extensions, that will let you build your own content-items.

  • I Like you're comment about no re-inventing the wheel. Indeed my first reaction is often to write it myself but my inclination to do so is more so that I can have control over the extra fields when I override the layouts for displaying the item and the creation forms. I'll check out fieldsattach and see if I can access the extra fields it attaches easily in the layout files. – jalbasri Jun 9 '14 at 18:33
  • I used fields attach to create a yes/no check box that then displays a star next to the article title in the blog layout. You DO have to override the article output in order to display the field output, but it's pretty useful. – Brian Peat Jun 9 '14 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.