I have two static collections (event, org) from Xano. How can I link directly from one collection page to the other in the editor?
Static collections use different ids than the Xano item id, so it is unpredictable. I could link directly to the URL, but that does not work in the editor.
Is there a workaround? Maybe I could add the static collection id to Xano somehow? Or bind the static collection id to match the Xano item id?
Here is an example on the Event page where I would like to link to the Org page.
Are you using a collection list to display your data on the page that you want to link from? That is what I would recommend.
If so, when you link to a page like you are in the editor, WeWeb will send along a query string parameter with key = pageCollectionIndex. This will identify to the editor what data to populate the page with.
If you are not using a collection list, then you are going to need to construct the URL from the data that you have and use an action, and a bit of javascript. So, in that case, you’d need something like “location.href = mysite.com/motion_fine_art” … where you pull “motion_fine_art” from the data that you have.
I’m not sure what that location.href will do in the editor. Haven’t tried that to an internal page.
I may have misread what you were saying … to the other in the editor … are you just wanting this to work in the editor?
If you want it in production as well, you will want to do the same thing:
Include a collection list on your Organization page that has the Event(s). WeWeb should take care of the rest if you just link to it. Is that not working?
You should not need to add any query string parameters.
Thanks for the reply! I didn’t think to do that, and your idea should work except for a possible bug. When I filter or sort a static collection, the “pageCollectionIndex” uses the new location in collection list as the query. So if I filter the collection to match the organization of the event, it will always go to [0], even if it should go to [123]. See it in action below:
That does work better for the ascending, but that is still a problem for two reasons:
When I filter the static collection list with user input, by “State” for example, the index numbers change.
I don’t think sorting the static collection solves the original issue, how to link to another static collection item, because the collection list has to be filtered to one result and that will be index [0]. I don’t see any way to filter the static collection with at the collection level when loading the page.
Hmm, I don’t see that option for a static collection. In either case, I’m worried that filtering the static collection that way will affect other users. If one user filters by State at the collection level, won’t the other pages be removed for everyone?
Unfortunately, it seems like linking directly to a static collection page is not ready. Perhaps custom code would fix, but that may not work in the editor. I have switched my site from static to dynamic and back to static, looking for the best solution, and this is another roadblock.
Unfortunately, I can’t think of a simple solution. Links to static collection pages don’t work when the data is filtered because we use the id in the unfiltered Collection to create the page.
It’s something the team is aware of and looking to improve but it hasn’t been prioritized yet.
I’ve added it to our public roadmap to help us prioritize it in the future. No action needed on your side. I’ve already included your upvote
Thank you for your reply and action on this! I may just wait and see if it gets traction on the roadmap because I am waiting on a few more features before launching (need rich text in forms, want xano social auth). Static collection lists and pages seem to load much faster, and SEO will be vital for a new public site.
Ideally, static collections would work like Custom Application Development Software for Business - Salesforce.com, and the item id could be bound to the xano id. Then, in the link panel we could choose “collection page” and add the collection-name and item-id. This could skip the additional single-item filtered collection list that @kevinwasie helpfully suggested.
I’m looking to do a similar thing to @foliodc - simply want to display a sortable/filterable static collection list where each item correctly links to its respective collection page.
Improvements on static collections haven’t been prioritized because the team is laser-focused on dynamic web-app use cases.
However, you can now have dynamic parameters in a page URL so you can have a nice URL for unique item pages from a collection list (you don’t need query strings anymore).
Does that help at all or do you need the collection to be static?
Got it! I’ll pass it along to the product team but can’t make any promises. If I remember correctly, we initially thought it would be a quick fix but realized it was more complex than expected so decided to prioritize other things.