1

I prepared a component and i have to add different categories and custom items with lots of fields in my component.But What i want is to display all the joomla's fields for adding a new item in my new component's new item form. As an example, if i go components->weblinks->links page and click new, i see lots of default fields of joomla like status, access, publishing options, metadata options...

Those same fields i want to have when i add my own item having lots of fields for that item too. This way i can take advantage of ordering, sorting, display by different options, add metadata....when i list my items, simply same as components->weblinks->links page.

So how do i take advantage joomla's form, list...codes to achieve my goal??. Please lead me to right direction providing full tutorials if available. Thanks in advance, hope i made things understandable.

1 Answer 1

2

You have to add all of the options you want into your form's XML file. I suggest looking at com_weblinks and its form files under models/forms, its edit view to see how it is displayed, and the database schema to see how you will need to store the data.

4
  • in which file do i see database schema? what if i leave those fields i am talking about, what are the disadvantages for that??
    – dev-m
    May 4, 2014 at 20:57
  • The database schema for the full application is at installation/sql/<database_type>/joomla.sql and you'd want to look at the #__weblinks table. Whether you add those fields or not is up to you honestly. There's no penalty for not using them, but if you need them in your component, you should use them.
    – Michael
    May 4, 2014 at 21:56
  • hm got it, i thought that joomla uses those fields specific to component for various purposes globally like for searching purposes and other...
    – dev-m
    May 4, 2014 at 22:31
  • There are some standardized names which if you want to easily hook into some parts of the code base you should use, but without you doing the work of writing a search plugin for your component for example, Joomla doesn't automatically pick up your data.
    – Michael
    May 5, 2014 at 0:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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