11 years ago
4
Topic

Hello community!


I'm very new in SEBLOD. Maybe my "problems" are laughable...

I have a form 'Date' containing several fields - i.e. Description, Date, Price. The fields of this form are stored in a table '#__cck_store_form_dates', which I manually created (is there a way to have SEBLOD create such a table automatically?).

I have another form 'Tour' based on 'Article' - that means, it's fields are stored in '#__content'. This form is containing a Group X field using my form 'Date'.

A 'Tour' can have multiple 'Date's.

How do I "connect" these two forms/tables with each other?

Why do I need a separate table for 'Date' form?
- Because it shall be possible to search for "Tours" within a given date range and/or price range (or can I do that in another way?).
- Additionally the next date and the lowest price of a 'Tour' shall be displayed in frontend (how do I achieve this?).

Could you, please, help me?

Many thanks in advance!
Gerald

Get a VIP membership
gba
11 years ago
3
Level 1

No one having any idea?!

11 years ago
2
Level 2

Hello gba,

welcome on SEBLOD.


The first thing to do with SEBLOD, it's to not to think "table",  let SEBLOD doing what he has to do.


A groupX is a field which allow you to repeat a group of fields. The best way to do that:

  • 1 - Make a content type (the group) with all fields with NO storage.
  • 2 - In your general content type, add a GroupX field, in which you set the name of the previews group.
  • 3 - The GroupX MUST have the storage " Custom | Article | database_field[my_field] "

That's all you need to do.

if you don't play with the padlock in the form view, SEBLOD store your fields in a table "#__cck_core_store_form_nameofyourcontenttype".


Now, if you want to make a search on date range, it's a little more different.
In the group, the field "date" must have the same storage as the groupX field in the main content type, like that :
" custom | free | #__cck_core_store_form_nameofyourcontenttype | database_field " (without [my_field]).

And for date range, you will need this field 2 times, so you must create an alias of this field, like that:
name : date_alias
storage : the same : " custom | free | #__cck_core_store_form_nameofyourcontenttype | database_field "

After that, in the search form, add those 2 fields, with option 3 select the matches:
  • First field :  "Date & Time Futur"
  • Second firld: "Date & Time Past"
and in option 3 parameter (+), set on which collection those fields are linked.


Hope it will help you.

Best regards.
Lionel
11 years ago
0
Level 3

Was exactly what I was looking for.

But how do you display such a group X content in a table format on the content view?

10 years ago
0
Level 3
Sorry for the stupid question, but what do you mean exactly by "Make a content type (the group) with all fields with NO storage"?  Do you mean specifically "None" as opposed to "Standard/Custom/JSON"? I have already set my field within the Content Type group to Standard storage and have entered a lot of data.  How do you convert from one storage type to another without data loss?  (is that too much for one post?)
Get a Book for SEBLOD