Search

In the tutorial ‘Say Hello to Symphony’ a greetings section is updated and a new data source is added. Two pages are created - an index page to display all the greetings as a list and a ‘greetings entry’ page to display individual entries via URL parameters.

When a user visits www.mysite.com they click on a linked greeting title and they are taken directly to www.mysite.com/greetings/entry-title.

I would like to display this list of greeting titles on the greetings page itself (rather than the homepage), then have them link through to display full individual entries.

Seems simple, yet here I am - any ideas?

Something like the following should get you most of the way there:

  1. Open your Greetings Entry page, and change the handle to view.
  2. Open your Home page, change the name to something Greetings and the handle to greetings. Remove index from the page type field.
  3. Now go back to your Greetings Entry page, and change the parent page to greetings/

That should make what used to be your home page available at http://yoursite.com/greetings and the entries available at http://yoursite.com/greetings/view/entry-title.

Now, all that remains is for you to update the XSLT templates with the correct href URLs. I’ll leave that task to you. Give it a shot and if you have any problems, let us know.

Everything went to plan - thanks for advice.

Any thoughts on how I might remove view from the URL altogether? It doesn’t seem to serve any real semantic or SOE purpose, so ideally I would like the full URL to be http://www.mysite.com/greetings/entry-title

Thanks again.

Well, the problem is that the two pages, Greetings and Greetings Entry, have different data sources attached to them and different templates for rendering their content. It is possible to combine them, but there are performance and complexity implications for trying to stuff all of that into one page.

Ah. This may be a problem.

I’ve noticed that others using Symphony have adopted the view/detail URL structure. I assume this is being done for the reasons stated above?

Although this alone definitely won’t stop me from using Symphony (after wrestling with Wordpress I’m a big fan) it does strike me as being a little out of step with convention.

There’s always the URL Router extension.

it does strike me as being a little out of step with convention.

Yeah that’s fair, but Symphony is unconventionally powerful ;) This issue you’re having is a byproduct of Symphony’s modular architecture, and most of us are willing to trade the extra bit of URL for a level of flexibility that no other CMS (in my experience) even comes close to. But, as always, it’s all about meeting specific needs for specific projects… and that’s a decision only you can make.

I use a master/detail viewset, done the way you want to do it. There is a little trickery you can do in your datasources to limit the amount of data returned for each datasource, using the required parameter. I’ve been through this before on the forum, although I don’t recall which post it was.

Nick explained it to me originally, so it should be in my list of started discussions, on my profile.

I’d dig it out for you but I’m snowed under at the moment.

It’s definitely possible, but as Craig explains, there is a little more overhead than the tutorial method.

Thanks to both for your help - i’ll be sure to look around for the discussion with Nick.

If you’re making a small/simple site you can reduce complexity by using the Root Page Params extension. I’m not sure what ramifications this has for other pages and params which I why it’s probably best to only use it on a simple site. But it works well if you just want a really clean URL structure.

It’s a cool extension, but only works on one page, I’d love it if it worked on more…

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