CGBlog search results by category

A place to make for-pay "CMS made simple" job offerings
Post Reply
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

CGBlog search results by category

Post by carasmo »

There are four categories:

Category 1
Category 2
Category 3
Category 4

When a person searches the site, I need to return the results and go to detail page for that category. From my code below, as you can see it goes to the blog detail page and shows up fine, for all categories, what I want is something like the second code chunk,

Code: Select all

{*start blog*}
{if $entry->module == "CGBlog"}

<li>{$entry->title} &mdash;
{capture assign="results"}{CGBlog action=detail articleid=$entry->modulerecord detailpage="blog" detailtemplate='searchresults'}{/capture}
<a href="{$articleURL}">{$articleTitle}&mdash;{$articleDate}</a></li>
{/if}
{*end*}
THIS IS WRONG, I don't know what I'm doing here.

Code: Select all

{*start blog filter search*}
{if $entry->module == "CGBlog" & category == "Category 1}

<li>{$entry->title} &mdash;
{capture assign="results"}{CGBlog action=detail articleid=$entry->modulerecord detailpage="category1" detailtemplate='category1searchresults'}{/capture}
<a href="{$articleURL}">{$articleTitle}&mdash;{$articleDate}</a></li>
{/if}
{*end*}
Please PM the estimated hour range to do this and the price per hour, gotta tell the client.

This link below has instructions for results based on language and category, the entire site is in english, I just want it filtered on category:

http://blog.arvixe.com/creating-a-multi ... ms-module/
psy
Power Poster
Power Poster
Posts: 463
Joined: Sat Jan 22, 2005 11:19 am

Re: CGBlog search results by category

Post by psy »

Not sure if it will help BUT check my forum topic http://forum.cmsmadesimple.org/viewtopi ... =4&t=61947

This topic was related to News but I'm sure with a bit of tweaking it could work with CGBlog.

The trick is to refine it to your requirements in the {if}{else} statements. Get the whole Search results then filter down to those you need for each module category.
Post Reply

Return to “Help Wanted (commercial)”