I am working a site where I’d like to pass data from the URL.
TV’s are great, but I dont want to have to create a page for every scenario -
Is it possible to write a TV that can take the parameter of a Friendly URL?
My example calls for looking movie titles by beginning letter.
I have the alphabet laid out, clicking a letter will display all movies with the letter a.
I’d like the URL to look like ’/letters/a’ and the a is passed to letters, which the TV can deal with to lookup.
How can I set this up?
Thanks
Rich
But how do I setup modx to know letters/a is not another file to lookup
but really a parameter:
letters?letter=a
then I can look up in a table all titles that begin with a.
that should look like a directory
letters/a
Rich
Hi,
you can add a where clause in ditto call.
&where=`sc.pagetitle LIKE ’%a’`
you could write a little snippet to retrieve the $_GET param and then
&where=`[[getLetterParam]]`
:-)
I follow you on those pieces - I guess I am stumped how to make modx see an on-the-fly directory path as a GET parameter.
great solution helio.
You could just create a snippet to parse your url string and get your letter there. I realize this isn’t as simple as a REQUEST var but if SEO for this site merits this kind of thing it’s a pretty simple solution.