
Luke
Staff
/ Moderator

Sep 16, 2002, 6:10 PM
Post #3 of 9
(5332 views)
Shortcut
|
|
Re: [InSite] Template: News Display
[In reply to]
|
Can't Post
|
|
Hi, This is actually a tricky question and took a little bit of time to come up with a solution. It's actually very similar to my solution in the "columns" thread so I used the example of my thread in there and reworded it a little. :) What you could do is use your regular front page index to display the first 3 headlines with summaries, and then use an SSI to include the search results of headlines 4 through 10 without the summaries. Here's how to do this. 1. First log into Article Manager and go to the "Setup Options" -> "Server" tab -> scroll down to "Publish Settings" and set the "per page" value for the "Global Index" to 3. 2. Create an exact duplicate of your /search/search_results.html template, you can name it _search_results_headlines.html. Modify the _search_results_headlines.html to exclude the $art_summary$ placeholder so none of your summaries are output. Save the _search_results_headlines.html template file in your /search directory. 3. Now create a direct link that links to all of the search results of articles 4 through 10. You can do this by passing something similar to the following URL and query string: http://www.yourwebsite.com/artman/exec/search.cgi?start=4&perpage=7&template=search/search_results_headlines.html The start value (e.g. start=4) determines at what article the search results will start at. In this example I started displaying the search results starting at the 4th newest article. The 'perpage' value determines how many articles will be displayed per page. The 'template' value verifies which template to use for outputting the search results. I used the search/search_results_column.html template file, the new trimmed down search results template file. 4. Now use a virtual include to call the search results of articles 4 through 10 into your Front Page. You'll want to add something similiar to the following SSI to your /index/default.html template file. (it'll go just under where your regular articles with summaries will be output) <!--#include virtual="/artman/exec/search.cgi?start=4&perpage=7&template=search/search_results_column.html" --> 5. Lastly, you'll have to hard code the moreheadlines link in the 'search_results_headline.html' template file. This is done so the the next set of headlines will start at article 11 and use the proper search results (search/search_results.html) template. e.g. <!-- templatecell : next --> <font class="text"><a href="http://www.yourwebsite.com/artman/exec/search.cgi?start=11&perpage=10&template=search/search_results.html">More Articles</a></font> <!-- /templatecell : next --> Also, you'll probably want to remove the more headlines link in the /default/index.html template file. <!-- templatecell : more --> <a href="$more_url$">More Headlines</a> <!-- /templatecell : more --> To this: <!-- templatecell : more --> <!-- /templatecell : more --> And that's it. Let me know if this helps, if you have any additional questions feel free to let me know. If you need help setting this up just send me an email directly to luke@interactivetools.com. One thing to be aware of, because this method calls the search script on every view of the index page it will put some additional load on your server. No more load then when you run the search script regularly, but the index page is likely viewed more so it will be more CGI calls. Also, not all web servers allow you to pass a query strings using a Virtual Include. I tested this example on a Windows IIS server and Apache. Unfortunately it didn't work on Windows IIS, but it works fine using using an Apache server. Apparently there is a way to do it with IIS and if anyone needs to know how just let me know and I'll check into it. Luke Holzken Product Development
(This post was edited by Luke on Oct 2, 2002, 4:07 PM)
|