Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 1:
Template: News Display

 

 


InSite
User

Sep 13, 2002, 4:37 AM

Post #1 of 9 (5408 views)
Shortcut
Template: News Display Can't Post

Is it possible to have the top 3 items of news appear with headlines and summaries, and then another, say, 7 headlines appear without summaries on the main index page?

I guess some kind of loop would be needed, but it's well beyond me!

I know I can display the headlines underneath the top three stories, but it seems silly having headlines for the stories I've already listed on the same page.

Thanks :)


InSite
User

Sep 16, 2002, 4:38 PM

Post #2 of 9 (5338 views)
Shortcut
Re: [InSite] Template: News Display [In reply to] Can't Post

*bump*

I hate people who bump threads! Laugh


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)


InSite
User

Sep 17, 2002, 4:57 AM

Post #4 of 9 (5318 views)
Shortcut
Re: [Luke] Template: News Display [In reply to] Can't Post

Thanks Luke - I'll give that a go this evening :)

My site is run off a dedicated server, but it is a fairly busy site. Would doing this really add to the server load if I'm the only site on the server?

Thanks again!


Luke
Staff / Moderator


Sep 17, 2002, 3:46 PM

Post #5 of 9 (5289 views)
Shortcut
Re: [InSite] Template: News Display [In reply to] Can't Post

Like any website, it really depends on how much traffic you have. The best thing to do is just give it a try and see how well it works. It will help being on a dedicated server, and when you have it all set up you should be fine.
Luke Holzken
Product Development


InSite
User

Oct 2, 2002, 7:55 AM

Post #6 of 9 (5166 views)
Shortcut
Re: [Luke] Template: News Display [In reply to] Can't Post

I've been tinkering with this, and it does indeed work. However, I cant get it to fit into the page I want it to... I wanted to be able to pull the file into a PHP page.

http://www.footballforums.net/test_area/artman/

Everything on that page is done as a separate include - the top 3 stories are separate from the headlines. Is there a way I can include the search results via PHP, rather than shtml? Alternatively, can I make the headlines output excluding the first 3 items?


Luke
Staff / Moderator


Oct 2, 2002, 4:21 PM

Post #7 of 9 (5136 views)
Shortcut
Re: [InSite] Template: News Display [In reply to] Can't Post

Hi,

What you can do is try using a PHP include to call the search results into a PHP file and see if it works. Unfortunately since I'm not familiar with PHP I'm not sure whether this will work or not.

As for excluding the first 3 headlines (including only headlines 4 through 10), in my initial post in steps 2 through 4 I describe how this can be done. Of course, this method uses SHTML pages rather than PHP.

I hope this helps. :)
Luke Holzken
Product Development


anjanesh
User

Jul 27, 2006, 11:53 AM

Post #8 of 9 (2509 views)
Shortcut
Re: [Luke] Template: News Display [In reply to] Can't Post


In Reply To
What you can do is try using a PHP include to call the search results into a PHP file and see if it works. Unfortunately since I'm not familiar with PHP I'm not sure whether this will work or not.

This is what Im trying to do, as suggested by my client - getting the results using a separate template and parsing it using PHP.

I have one debug template right now which has only this :

Code
<!-- template insert : $article_list$ --> 
<!-- templatecell : row -->
art_name : $art_name$
art_date : $art_date$
art_time : $art_time$
art_summary : $art_summary$
art_content : $art_content$
art_field1 : $art_field1$
art_field12 : $art_field12$
cat_name : $cat_name$
cat_breadcrumb : $cat_breadcrumb$
url_index : $url_index$
detail_link : $detail_link$
art_printer_url : $art_printer_url$
cat_image : $cat_image$
cat_image_height : $cat_image_height$
cat_image_width : $cat_image_width$
file_categories : $file_categories$
file_headlines : $file_headlines$
art_num : $art_num$
cat_num : $cat_num$
art_day : $art_day$
art_mon : $art_mon$
art_year : $art_year$
art_hour : $art_hour$
art_min : $art_min$
art_ampm : $art_ampm$
<hr>
<!-- /templatecell : row -->
<!-- templatecell : row_summary --><!-- /templatecell : row_summary -->
<!-- templatecell : row_link --><!-- /templatecell : row_link -->
<!-- templatecell : row_ufile --><!-- /templatecell : row_ufile -->
<!-- templatecell : not_found --><!-- /templatecell : not_found -->

<!-- template insert : $more$ -->
<!-- templatecell : more --><!-- /templatecell : more -->
<!-- templatecell : no_more --><!-- /templatecell : no_more -->

<!-- templatecell : img_caption --><!-- /templatecell : img_caption -->
<!-- templatecell : img_nocaption --><!-- /templatecell : img_nocaption -->

<!-- template insert : $prev$ -->
<!-- templatecell : prev --><!-- /templatecell : prev -->
<!-- templatecell : no_prev --><!-- /templatecell : no_prev -->
<!-- template insert : $next$ -->
<!-- templatecell : next --><!-- /templatecell : next -->
<!-- templatecell : no_next --><!-- /templatecell : no_next -->

But I seem to get the following placeholders blank : art_summary, art_content, art_field1, art_field12

Any idea why ?
Thanks


(This post was edited by anjanesh on Jul 27, 2006, 11:59 AM)


MikeB
Staff / Moderator


Jul 28, 2006, 1:00 PM

Post #9 of 9 (2494 views)
Shortcut
Re: [anjanesh] Template: News Display [In reply to] Can't Post

Hi Anjanesh,

Thanks for posting! Smile

From what you've mentioned it's a bit tough to see what might be happening. If some of these fields are coming in fine and others are just staying blank then you may want to double check that this test article you're working with has a value for those fields.

Also, if you could direct me to this page on your site or provide me with any other details about what you're hoping to set up I should be able to have a look into this for you.

I look forward to hearing from you! Smile

Cheers,
Mike Briggs - Product Specialist
support@interactivetools.com

[hr][i][url "http://www.interactivetools.com/consulting/"][b]Hire me![/b][/url]
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 [url "http://www.interactivetools.com/consulting/"][b]Priority Consulting[/b][/url].[/i]