 | |  |
 |

jferry
User
May 14, 2008, 8:53 AM
Post #1 of 2
(237 views)
Shortcut
|
|
Complex Search
|
Can't Post
|
|
Hello, Is there a way provide results based on a complex query. Here is the setup. We have 1000 business listings and all are assigned to one of many categories. Approx 250 of these listings have a field called "Member" with "Yes" as the answer. Separately we have a category called "News" where we post news from any one of the 1000 companies in our database. Each news listing also has a field called "Member Number". We place the number corresponding to the Article Number (num) of member. Question: Is there a way to sort these news posts based on a boolean style query, or some other method so that only results from members will be listed. For now I am using a very long search results template that looks like the following. The actual template has 250 sections for each member number. <table width="100%" style="border-width: 0px; margin: 0px;"> <!-- template insert : $articleList$ --> <!-- templatecell : articleRow --> <!-- templateIf: $article.news_reference_number$ == "43885" --> <tr><td style="padding:0px 0px 6px 0px;"> <span class="text">$article.date:format(MMMM d, yyyy)$ </span><br /> <span class="text"><a href="$article.news_hyperlink$" target="_blank"><b>$article.title$</b></a> </span> <br /> <span class="text">$article.news_description$</a> </span> <br /> <span class="text"><b>$article.news_source$</b> </span> </td></tr> <!-- /templateIf --> <!-- templateIf: $article.news_reference_number$ == "43890" --> <tr><td style="padding:0px 0px 6px 0px;"> <span class="date">$article.date:format(MMMM d, yyyy)$ </span> <br /> <span class="text"><a href="$article.news_hyperlink$" target="_blank"><b>$article.title$</b></a> </span> <br /> <span class="text">$article.news_description$</a> </span> <br /> <span class="text"><b>$article.news_source$</b> </span> </td></tr> <!-- /templateIf --> <!-- templateIf: $article.news_reference_number$ == "43905" --> <tr><td style="padding:0px 0px 6px 0px;"> <span class="date">$article.date:format(MMMM d, yyyy)$ </span> <br /> <span class="text"><a href="$article.news_hyperlink$" target="_blank"><b>$article.title$</b></a> </span> <br /> <span class="text">$article.news_description$</a> </span> <br /> <span class="text"><b>$article.news_source$</b> </span> </td></tr> <!-- /templateIf --> (200+ more section are included in the actual results template) <!-- /templatecell : articleRow --> </table> jferry
|
|
|  |
 |

Jake
Staff
/ Moderator

May 15, 2008, 1:00 AM
Post #2 of 2
(226 views)
Shortcut
|
Hi jferry, Thanks for posting. There is actually a fairly simple way to cut down all of these templateIf's to a single statement. You would want to do the checking based of off your member field:
<!-- templateIf: $article.member$ == "Yes" --> ***Code here*** <!-- /templateIf --> Note that if you were to use this on a search results template, false positives would be generated which could cause problems with your next and previous links. This code should only be used on your global index or category index templates. Give that a shot and let us know if you need anything else! ----------------------------------------------------------- Cheers, Jake Swanson - Product Specialist support@interactivetools.com
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 | |  |
|