Search

I was chatting to Allen on the Symphony IRC channel earlier about the best way to handle 'virtual' pages (a page not created in Blueprint->Pages but by a section) in Symphony.

In the site I'm currently working on, I have 9 'top level' menu items

Home, About, Services, Products, Brochures, Case Studies, Specials, Careers and Contact Us.

The Services, Products and Case Studies will have sub-pages which will be managed by Sections of the same name. My problem is finding the best way to manage these virtual pages.

I've decided to use Symphony's Page manager for the top level menu items but to also create a Section for the content such as page title, keywords, description and content to allow it to be easily managed by our client.

So every page other than Services, Products and Case Studies will have its content managed by this section. Then in Blueprints->Pages i'll link the page to the matching System ID of the specific Pages section entry for each page. I'm doing it this way to keep the easy drag n drop re-ordering of top level pages.

The drawback of this method are if the client creates new content in the Pages section, my top level menu will have no page to match what is created and there will be no way to view the new content. Luckily, I'm pretty sure the 9 nav items will pretty much always be there without change.

So, on to the sub pages problem, being 'virtual' pages, they need to have a dedicated Page that will deal with whatever url-parameter is given to it so it can go fetch the necessary page content.

My current idea is to create a Page for say Services and get all the entries in that section, then when no url parameter is set, I fetch an Overview entry and display that as the Services page, when there is a url parameter, I look for a matching handle in my services entries and display that. The drawback here being that I have to call all the entries in the Services section.

There are alot of different ways to handle this, and from what I've seen Allen has pretty much gotten his head around it as tightly as anyone else you could ask.

The way I did it when I was in your situation was to have a field that marked a 'content page' entry as the index of its content section. Then you could create a datasource that filters by a $current-entry url parameter, and default to the entry marked as the index if there is no $current-entry url param.

How you do that specifically is up to you; you can do alot in S2 with DS parameter outputs that prevents having to call extra data into your source XML.

The way I've been approaching this lately is to completely detach a content page from a Symphony blueprint Page. This has some redundancy with the blueprint Pages, (defining nav position, title, page type, etc.) but it keeps things very straightforward. The reason it's simpler is that an entry page has a 1:1 ratio with actual URLs (assuming you aren't using other apps that use other url parameter schemas).

The way I did it when I was in your situation was to have a field that marked a 'content page' entry as the index of its content section. Then you could create a datasource that filters by a $current-entry url parameter, and default to the entry marked as the index if there is no $current-entry url param.

Hi Andrew, thanks for the reply, just wondering how you marked the content page as the index, did you use a field in the section, can you give me a more specific example.

Also where do you get the $current-entry param from, are you setting that manually in your xslt?

The way I've been approaching this lately is to completely detach a content page from a Symphony blueprint Page. This has some redundancy with the blueprint Pages, (defining nav position, title, page type, etc.) but it keeps things very straightforward. The reason it's simpler is that an entry page has a 1:1 ratio with actual URLs (assuming you aren't using other apps that use other url parameter schemas).

Can you give me an example of how your url's look using this method? Is it possible to have sub-pages? How would they work?

Thanks for your help.

just wondering how you marked the content page as the index

just a shot in the dark here, but I'm guessing he may have created a select box that has the different sections that might have the pages that need index pages listed in there.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details