Create a page for each instance of a specific snippet

11 views
Skip to first unread message

Luke Hobart

unread,
Mar 16, 2015, 6:12:55 PM3/16/15
to apostr...@googlegroups.com
Hey guys, I've been using apostrophe for the last week (first time with a cms actually), and I need to create a page for every team, and also show those teams in a list on the home page and in the Navbar, I'm currently attempting this by creating a team snippet which i am using to display the list on the home page and in the navbar, but I'm having trouble creating pages.

Apparently snippets are stored as pages in the database, if so it must not be too difficult to achieve this, thoughts?


Luke Hobart

unread,
Mar 16, 2015, 6:47:30 PM3/16/15
to apostr...@googlegroups.com
I think i worked this out, all snippets can have a show.html in their views folder, this is displayed when their url is accessed

Tom Boutell

unread,
Mar 17, 2015, 10:58:28 AM3/17/15
to apostr...@googlegroups.com
Yes... to display a snippet at its own URL, you create at least one snippet index page on your site (a "blog" for instance), and that becomes a base URL to which the slug of an individual snippet can be added (a "blog post"). The URL can have things like the date added to it, for aesthetic reasons (see the apostrophe-blog classic module). Which snippets are accessible on which index pages depends on whether you lock them down to display only snippets with certain tags or not.

Apostrophe will pick the best match it can based on those criteria when deciding the URL of a snippet in a context like displaying sitewide search results.

There are other approaches. Check out apostrophe-fancy-page and apostrophe-blog-2.

--
You received this message because you are subscribed to the Google Groups "apostrophenow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apostropheno...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--


THOMAS BOUTELL, DEV & OPS
P'UNK AVENUE | (215) 755-1330  |  punkave.com

Benedict Hobart

unread,
Mar 23, 2015, 11:06:15 PM3/23/15
to apostr...@googlegroups.com
Thanks heaps :)
Reply all
Reply to author
Forward
0 new messages