Join the Webstudio community

Updated 4 weeks ago

collection in a collection in a collection (category > page > subpage)

SOLVED (by myself ๐Ÿ˜‚ )
I know it's possible!

Trying to recreate the Webstudio Docs page just for fun.

Created a base in baserow with Categories, Pages & Subpages.
https://baserow.io/public/grid/5pM1Fpdheg1Tyzkoe_4bTtt5r89T9T_9r-813OVAWMg

I've got the first nesting working, to show all relevant pages beneath each category.

The challenge is to get the second nesting working, showing all subpages (if they exist) beneath each page.


What I thought so far:
subpage_["field_2910090"][0].id = 9
category["field_2909743"][0].id=9

Using ternary operator:
${subpage_["field_2910090"][0].id=category["field_2909743"][0].id ? subpage["field_2910088"]} : ''

Projectlink: https://p-01658867-c63a-4dc9-b4d2-9813137fc27f.apps.webstudio.is/?authToken=fa4ffb3a-690b-4bd6-b590-fa1b27d3d016&mode=preview
Attachments
image.png
image.png
M
R
Y
13 comments
I like this kind of project ๐Ÿ˜

I did the same thing: I recreate pages or websites I love to practice ๐Ÿ™‚
I think I got it ๐Ÿ˜ฎ
I got the filter I was looking for. Only need to figure out how to just not show the text spacing at all in case it does not exist
Ohww yeah ๐Ÿ˜Ž
Attachment
image.png
๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ
few people think to use the show button with expression but it's powerful. Congrats!
Got stuck at finding more than just the name or id of the pages. I needed the slug, but it turned into a large puzzle now ๐Ÿ™
๐Ÿ˜Ž Cool project
Ok figured it out. It took me one extra collection in between to get the linked pages from categories cat-pages. Quite complicated, but figured it out!
Attachment
image.png
Got the subpages working now as well ๐Ÿ˜

Looking back at this I wonder if this is the way or that there's a much easier structure.

What I think I have learned is that there's an extra collection in between needed (in my case cat-page) to get the specific id from a list of linked records. If the linked record is only a single record, it's easy. But multiple linked records require this technique. I think!

I would probably avoid creating linked tables whereever possible. In my case I could have a table with categories as a single-select field in the pages table instead of a linked table.

But it's nice to know that even though it might be complex, it's possible to achieve!
Attachment
image.png
Add a reply
Sign up and join the conversation on Discord