64 Posts
Topy
7 years ago
3
Topic

Hello. I would like to create a table like this: https://www.chalets1066.com/apartment-vermont.html

How can i do this ? I have read this topic: https://www.seblod.com/community/forums/forms-content-types/join-two-tables but i don't understand what should i do. Can anyone explain steps to do a custom table like this ?

In this table i will have same columns: Period, Price 1, Price 2 and the row will be manually added by the user but i want to give him flexibility to add this dates(Period) easy.

Thank you !

Get a VIP membership
1283 Posts
Bucklash
7 years ago
0
Level 1

Hi

So is the form like this:

id-of-content-type-period || price 1 || price 2

And is the List view like this:

content-type-period[some-data] || price 1 || price 2

Sounds to me like you want to

1

create the period content type that stores values ie

week1-2

2

Create your main content type that has a selec dynamic field that pulls in the id of period content type for the user to select

ie

SELECT a.title AS text, a.id AS value

FROM #__content AS a

INNER JOIN #__cck_store_form_period AS b

ON a.id = b.id

WHERE a.state = 1

AND catid = somevalue

3

Then in your main list search view you can add the join field

Join table on the id stored in select dynamic with the id in period table and then add the desired period fields to your list or item view.

If your period fields have padlock locked then you need to create new period fields that have storage location identical to the fields you are trying to access

Might be a little wrong in places but hope thy sets you on the right track 

64 Posts
Topy
7 years ago
1
Level 1

Thank you, Bucklash!


I will try tonight to create the table ... i'm newby on seblod... i'm learning now ! What i want to build it's a custom table with first column: Period, Price1, Price2. Then each row, the user must add in first column period or i can add 2 callendar buttons to select period and formate like this: 05.05.2017-30.05.2017 or 05/05/2017 - 30/05/2017...and the next 2 columns ( on price1 and price2 ) will be with value ( simple text - numbers format ).

Then i'm asking myself how to add this in frontend to articles... each user will edit this table on his articles (articles for me it's an unit). Can you guide me to some related articles that can help me to do this ? 

4229 Posts
Kadministrator
7 years ago
0
Level 2

Hi,you will need to do it differently in Seblod - you need 2 forms - "rental period and "article". In article form add button "add rental period" with redirect to period form and with parent article id passed as url parameter (see attached manual), so that you can store this value in rp form (in the form you add new text field parent_article_id with live value URL and variable you passed to the url) . 

User will need to add each period with prices separately. Then in article content view you add list field or module that will show periods search&list (you also need to create this one) - this search type would search periods based on current article id - show records that have parent_article_id field with the same value as current article id.

Otherwise I suggest you first read/watch manuals section to get an overview of Seblod concepts

https://www.seblod.com/resources/manuals

Get a Book for SEBLOD