This site uses cookies and similar technologies.

If you don't change browser settings, you agree to it.

I understand
1274 Posts
Bucklash
4 years ago
2
Topic

Hi, this post is a supplementary guide to help those understand the Field GROUPX

Check out  Learning::Fields::Group, and Learning::Fields::FieldX

     

Content Type 

Use an existing content type or create a new one. You should be familiar with this process before proceeding, if not check out the Seblod resources. The content type I am creating is based upon the Article Object (image: create-contenttype-articleobject). "Title: Trevor", "machine name: trevor" (image: create-contenttype-trevor)

image: create-contenttype-articleobject:

image: create-contenttype-trevor

 

Add Fields

In the Site Form View I added the default Admin From View fields using a shortcut - click the downward facing chevron underneath the column of numbers. When you hover over the chevron you will see a tooltip saying what it does: "Assign fields form Admin From view". Click it!! (image: assign-fields-shortcut). Next, filter to see the fields of type button, I used the Button Field Button Submit (image: add-field-buttonsubmit-01).

image: assign-fields-shortcut

image: add-field-buttonsubmit-01

 

Create Repeating Content Type

Save and close the form!! Create a new content type, call it what you want, add whatever fields you want, though start safe and easy with a text field, and get crazy when you're ready. I created a content type called Yum, from blank, base upon Article Object type, and added two fields, both with the padlock open and both with "storage: none" (image: add-fields-yum-contenttype-nachos) as the GroupX field will handle the storage instead (you can try with the padlock closed, see what difference, not sure myself). I added a text field "title: Nachos", and an image field "title: Jalapenos", (image: add-fields-yum-contenttype-jalapenos), I did not change any settings for this image field. You do not need a submit button as the Trevor form will handle that, just have the two fields (image: yum-contenttype-fields).

image: add-fields-yum-contenttype-nachos

image: added-fields-yum-contenttype-jalapenos

image: yum-contenttype-fields

 

Create GroupX Field

Save and close the  Yum form and open the Trevor Form. The next step is to add a GroupX field to the Trevor content type which will allow the user to add multiple times the Yum content type. I gave it "title: Mexico GroupX", "name: mexicogx". Storage for GroupX is like this:
Format / Object: CUSTOM | 'Object' | db_column_name[machine_name_of_repeating_content_type]<br>
	

So for this example it would be 

Format / Object: CUSTOM | Article | mexicogx[yum]<br>
	

(image: add-groupx-field) (note: 'mexicogx' is the db column name and also the groupx name. They do not have to be the same!!)

image: add-groupx-field

 

Add Content

Save the form! In Joomla! admin menu, select menus, main menu. After page loads click new. Select the menu item type of SEBLOD, then Form. Choose the content type Trevor. The Menu Title will auto-populate with Trevor. Save!! Head to the front end of the site, navigate to the newly created menu item (Trevor) and enter some values to your Trevor Form which should (fingers crossed) contain the GroupX fields (image: add-content-trevor). I added "title: We All Worship Mexican Food", I selected a category, and I added two sets of the Yum content type using GroupX. (image: db-groupx-stored-data). A new table was created extending the #__content table with specific reference to the Trevor Content Type: #__cck_store_form_trevor. In the table is the id of the article (20 in this case for me) and the groupx data stored in Seblod syntax in the db column defined by the storage settings when we set up the GroupX field (image: add-content-trevor).

image: add-content-trevor

image: db-groupx-stored-data

BE AWARE: The GroupX Field does not carry over any settings stored in the content type you are repeating,  like class, or live values etc...

Note: When I am more clued up I will extend this post with details on how to call the values stored by a GroupX.


Clear as mud?

Bucklash

Get a Book for SEBLOD
235 Posts
Giuse
11 months ago
1
Level 1

HI, I am afraid the storage proposed in this example is not correct: the storage for the GroupX field should not be

CUSTOM | Article | mexicogx[yum]

but just

CUSTOM | Article | mexicogx

according to the official tutorial and also this forum post

Do you agree?

cheers

Giuse

1274 Posts
Bucklash
11 months ago
0
Level 2

Hi Guise

Yes you are right.

Might alter this post to make clear 

Is fieldx the same ? ie

fieldx:

custom | article (etc) | fieldx_name

field_repeat :

custom | article (etc) | fieldx_name[field_repeat]

For fieldx and groupx should the storage have to be same as field name as shown above or can they be different? ie 

fieldx:

custom | article (etc) | fieldx_1

field_repeat :

custom | article (etc) | fieldx_1[field_repeat]

Get a VIP membership