FR: sort search results by category
Posted: 09 July 2008 09:42 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  192
Joined  01-21-2004

It would be nice to display search results by category.

This works great:

{exp:search:search_results }
{if weblog_id
== '5'}


{title}
- {phone} <br />

{/if}

{
/exp:search:search_results}


What I would like to do is this:


{exp:search:search_results}
{if category_id
== '46'}


{title}
- {phone} <br />

{/if}

{
/exp:search:search_results}

Thank you!!

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 22 July 2008 12:40 PM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  157
Joined  02-08-2008

Did you try {if category == ‘46’}? {category_id} is the category tag parameter.

 Signature 

Imp Designs

Profile
 
 
Posted: 22 July 2008 01:24 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  192
Joined  01-21-2004

I just tried, and it didn’t work…this particular feature seems to require some custom sql. Oh well!

Thanks for the suggestion, though

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 22 July 2008 01:27 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  157
Joined  02-08-2008

Ah ha, but did you try {if {category} == ‘46’}? Or even {if {categories}{category_id}{/categories} == ‘46’}?

 Signature 

Imp Designs

Profile
 
 
Posted: 22 July 2008 01:34 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  192
Joined  01-21-2004

Thank you again for your help - alas, neither of those two conditional statements gave me any luck.  I’ll keep digging around - I might go with a custom sql query, but for now I think it would be a nice feature.

Warmly,

Bill

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 62686 Total Logged-in Users: 45
Total Topics: 77251 Total Anonymous Users: 34
Total Replies: 417014 Total Guests: 258
Total Posts: 494265    
Members ( View Memberlist )