EE Insider Tips
Sponsored by Mijingo's EE 2 Screencasts
ExpressionEngine mini-howtos created by the EE Insider community.
Flexible weblog entry searching by passing URL segments.
Inspired by Justin’s tip passing variables via the URL, something similar I’ve used is for an album review site to give additional search options:
a weblog for the album review may also include other info, eg label, artist, year, city, country whic you may then want to be links that take you to a page of all other albums by that artist, on the same label, from teh same city.
Artist: <a href="http://eeinsider.com/albums/search/artist/{artist/"}">{artist}</a>
Label: <a href="http://eeinsider.com/albums/search/label/{label/"}">{label}</a>
City: <a href="http://eeinsider.com/albums/search/city/{city/"}">{city}
then on the next page, display results using a simple weblog entries and the search parameter:
{exp:weblog:entries weblog="albums" search:{segment_3}="{segment_4}" disable="pagination|trackbacks" orderby="title" sort="asc"}
the downside of using the URLs to pass variables to pages, is the 404 issue - not sure how well you could manage those as you need the flexability to have URLs not relating to pages.
Email
Print
Post to Twitter
Post to Delicious
Add Your Comment?
You must have an EE Insider account to post comments on Insider Tips. It's fast, easy and hassle-free.
Sign up now (or login).