How to create a new Content Type for use when creating a new list?

chris.paschen

Chris Paschen
Is there a way to create a new 'content type' that can be used when creating new lists?

I need to create several tables that all have the base 'starter' fields (which appears to be a good use of the 'Content type' option); however, I can't find how to do that.

Can someone point me to some docs/tutorial or explain the basics?

Thanks.
 
Go to the Forms tab. In the Content Type column, "Export" the one you want. Create a new List. After saving, when it prompts for the Content Type, your new type should be in the options.

If you want to use it on a different site, "Download" instead of export, and upload on the new site to ./administrator/components/com_fabrik/models/content_types.

-- hugh
 
Sorry, to clarify ... it is the group NAME and LABEL that retain the Name/Label from the original form.
It does create a form with the proper name. So with just a couple minor manual renaming of the group it is functional.
 
Yup, we only rename the list and form with the one you gave when creating the List (or Form) you applied the content type to. If you want to then change group or element names / labels within it, you can.

-- hugh
 
The 'default' doesn't work that way. Is there a way to manually change the XML/files generated so that it would pick-up the list name?

Basically, I want to create my own 'default' set of fields that I use on almost all tables (including things like 'edited' indicators, 'state' field, etc.)
 
The files are in /administrator/components/com_fabrik/models/content_types
You can edit (if you know what you are doing).

As you can see in default.xml it's using the placeholder {label} as group name and label.
But this will only do if you have one single group.
 
Not sure what you mean by "the default doesn't work that way"?

I just tested with a content type I generated from an existing form. The list/form I created it from was "Add Only", with an underlying table name of fab_add_only. So I create a new list, give it the label "Fab Add Only Test", which the standard "label to table name" converted to fab_add_only_test. After saving, the content types prompts me for the type to use. I select the "Add Only". The resulting list/form is called "Fab Add Only Test", sitting on the new fab_add_only_test table:

https://www.screencast.com/t/5NE3svb9Vxl

Is this not the behavior you are seeing, or that you need?

-- hugh
 
Ah, are you talking about duplicating the form/list name into the default group name?

Yes, as Troester says, you can use the {label} placeholder by editing the XML. But that will only work for one group. Don't name more than one group the same thing, as we use that name as a unique array index in template rendering.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top