2 users online. Create an account or sign in to join them.Users

Search

How can I do two url parameters for a page?

I thought I’d be able to comma seperate them, but in the param pool I get $article, date

… not what I was expecting…

It’s probably a stupid question.

You can separate them as you would in the URL, i.e., with forward slashes param1/params2.

Cheers, I’ll try it when I get home!

Ok, I understand that now. So then, how could I do filtering by date say:

/archive/2010/03/15

So that each level from /archive filtered out more articles, yet uses one standard symphony date field in the section? I suppose I would have to use the xPath substring() function, but I don’t know where to put that…

Cheers in advance…

Ok, I understand that now. So then, how could I do filtering by date say: /archive/2010/03/15

You can do that by using a single date field and a single datasource. Just setup to filter by date based on those URL parameters. Something like:

From {$year-$month-$day} to {$year-$month-$day}

If you only have $year and $month (/archive/2010/03/) it’ll pull all articles that match.

FYI, you can also use get parameters which don’t depend on a preceding parameter (as $day would depend on $month in your example).

Thanks guys.

FYI, you can also use get parameters which don’t depend on a preceding parameter (as $day would depend on $month in your example).

I would want them to depend on each other for a canonical structure, but thanks anyway!

@Makenosound, thanks for that! It turns out though that I needed to do it as

{$year}-{$month}-{$day}

to get the parameters to register correctly.

Thanks for the suggestion, I would never have got it otherwise! I was thinking too complicated, it’s really simple when you see it…

Cheers.

Glad you got it working. Sorry the example was incorrect, I was pulling it from my oft-hazy memory.

No need! I always get this stuff wrong, so many helpful people on here which is good for me… :)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details