Remote collections: Show list of data and detail of data in a page #713
kresnasatya
started this conversation in
Show and tell
Replies: 1 comment
-
These are explained in the docs for remote collections: If you think it's not clear enough, the docs are open source and you can submit a PR to improve them: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Jigsaw support remote collections. Let's take an example by have a page name events that load list of events.
Now, here's the difficult part: how to show detail event in a page (e.g. event)? Yesterday, I have confused for couple hours to figure out. I check in Jigsaw documentation but there's no a real and clear example for my case. Luckily, I found the GitHub issue in Jigsaw repo that give me a hint how to solve it.
Let's add
filename
andextends
keys into events collection inconfig.php
.The
filename
key use as a path to go the detail event. Theextends
key use as a template that we used for display event detail.Here's the update of
source/events.blade.php
.I don't set method
getUrl()
in$event
data. I think this is a Jigsaw's feature to inject page metadata to the$event
data. It happens because I setfilename
key previously inconfig.php
.Next, we create a
event.blade.php
insidesource/_layouts/event.blade.php
Why use
$page
variable instead of$event
variable? I have try it before but I get error because Jigsaw doesn't recognize it. Then, I use the$page
variable that come from Jigsaw and it works.Closing statement: Jigsaw has a great feature for fetching data with remote collections but currently Jigsaw doesn't have a clear example how to show detail data from remote collections into a page. I don't realize that
filename
andextends
keys are "magic" in Jigsaw'sconfig.php
. Also, I don't realize that$page
variable is a "magic" variable from Jigsaw.If you want to see more detail, you can visit this commit from phpbali-org.github.io repository: phpbali-org/phpbali-org.github.io@e48b3bf.
I hope it helps anyone that have the same problem with me. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions