List default value

6 posts by 2 authors in: Forums > CMS Builder
Last Post: May 14, 2019   (RSS)

By Jesus - April 8, 2019


I'm working on a directory project. 1st I'm creating a Category editor.

I'm creating a CatRoot field (list a field) where I need to have a default value (0|Root) for every record. 

I'm also using here a list options as for subcategories I'll need to select the main category for each record. So my list options are like in the attached file.

Basically I just want to have a default value for each record (0|Root) (Number zero (as the value) and Root (as the label)).


By Jesus - May 12, 2019

Thank you Greg this worked :)

Now, how can I save the record for this field (as I'm thinking to relate this record for my Sites section like this:

1|Arte y Cultura
2|Arte y cultura/Nuevo León
3|Arte y cultura/Nuevo León/Centros Culturales
4|Arte y cultura/Nuevo León/Galerias de arte
5|Ciencia y tecnologia
6|Ciencia y tecnologia/Ciencias de la Tierra y del Espacio
7|Ciencia y tecnologia/Ciencias de la Tierra y del Espacio/Astronomía
8|Deportes y entretenimiento

I'm thinking just one field (in place of two) as I'll use it later in my Sites section in order to build the permalink for detailed pages.



By gregThomas - May 13, 2019

Hey Jesus,

So you want to display the breadcrumb (the parent records title field of each entry in the drop-down) as the records are from a category section?

Do you have a field that contains the value you want to display? For example, for the record Centros Culturales, do you have a field that contains Arte y cultura/Nuevo León/Centros Culturales?

Greg Thomas

PHP Programmer -

By Jesus - May 13, 2019

No, but that's exactly what I'm trying to do.

Right now my category table looks like this:

  • Title (Category name)
  • Subcategory of (select list)
  • Description
  • permalink

Then in my Listing table I currently have:

  • Title
  • Category (list of categories from my category table)
  • URL
  • Description
  • permalink

I want to display one page per each category with all the Sites (listings) 


That will display all listing from subcategory2

So... I'm trying to understand how can I accomplish this.

At this point I might need to add/include new fields on any table I'm just trying to make it work or to adjust the logic of all this in order to make it work

Thank you for your help!


By gregThomas - May 14, 2019

Hey Jesus,

Thanks for the extra details. You'll need to update the category dropdown in the listings table so that it shows the permalink as the label. Then you can use the getRecords function to pull all of the relevant listings on the category detail page on the front end of the site.



Greg Thomas

PHP Programmer -