Search

Hi Guys,

I’ve just started out with symphony which i’m finding great! I’ve a strong background in front end work - xslt / css / javascript.

Right my problem is best described by this

$root/$category/$article-name

I am a bit arsey about the structure, and 404’s

I’ve set-up sections which i use to create pages, including

-page title -meta tags -category

category is used to pull in 6 latest articles from the category of the page. - this works fine 404’s when theres no section ect

i want to then be able to click on one of the article headers to see the article detail page. - stuck here!

the only way i see to achieve this is by using some xslt hax, and using an aditional datasource which looks for a specific article.

any help would be greatly appreciated.

Also i attempted to create a sub-page that could accept $article-name as a parameter but this takes precedence over my home page-section jobby.

Regards Treemonkey

Welcome Treemonkey :)

You cannot have an url structure like $root/$category/$article-name because you can’t add parameters to the index page.

Create a new page (i.e. articles) and setup your url as $root/articles/$category/$article-name. Alternatively you could use something like Root page params extension.

Sorry forgot to mention that,

Currently using the root page params extension!

so homepage resolves to same criteria as one of my category pages. i set a section up for it so if the {$category} is blank then it uses section with title of ‘0’

This is something that happens a lot in my projects.

I normally solve it by having two datasources (articles-index and articles-detail). The articles index shows 10 (or so) articles (for the article listing), while the detail datasource only displays one (for the article detail page). Also, the details datasource is setup to only return a result when the article url-parameter is set. (All of this can be setup in the datasource-editor).

Then, I have two xslt templates, one for the index, and one for the detail. In the page xslt, I include one of them, based on the value of $article.

This way, only the index datasource is loaded when it is not needed (which might come in handy for a “other articles in this category” kind of menu.

Hi there

I thought this was how it may have to be done…

I think my worry is how to add multiple sub categorys without amassing a boatload of xml that wont get outputted.

Category->Sub-Category->Item

Category->Sub-Category->Sub-Sub-Category->Item

wonder if theres a way to disable a datasource based on the hierarchy length?

I believe there is something like a datasource filter extension that allows you not to use a datasource if a parameter is set. Can’t remember the name though (will look it up). Found it.

Or if you are happy customizing your DSs you can follow this tip.

Thats ace!

Thanks creativedutchmen should be able to do some funky stuff with this :) will end up with entire site running from 1 page hehehe

nice one klaftertief will certainly look at this!

cheers guys v.helpful :)

I had a similar situation a few weeks ago but decided to go for a multiple-page approach.

The site was a magazine containing issues, categories, subcategories and articles. I went for:

  • issue/[$issue]
  • category/$issue/$category/[$pagination]
  • subcategory/$issue/$subcategory/[$pagination]
  • article/$issue/$category/$subcategory/$article/[$pagination]

It’s not perfect hierarchy-wise but also not relying on stuff like URL router or root params (in my experience both didn’t seem too stable).

I’ve nailed it!

Using a combination of

  1. root page params here
  2. customising the data source with help from this here

data source guide is a tad misleading you must remove the ! before empty to make sure it is checking that the parameter is not there.

@phoque: Can you please share the unstabilities in the root page params extension? If there are bugs, I would like to get them fixed (I use it in a lot of my own projects, too).

Thanks.

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