viewnews template

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

viewnews template

Postby Maxine MagicFox » Tue Nov 13, 2007 5:23 pm

Hrrrm, I searched through old posts but didn't find the answer to this. I think it just might be that I don't have a very strong knowledge of these things.

I'm trying to get individual news posts to load in my site design using viewnews. Right now, they are only exhibited on the main page of my site (http://mcloz.net/) but I'd like, at least for the RSS, to be able to only see one individual posts at a time. That's done with viewnews, right?

Like this: http://mcloz.net/cgi-bin/viewnews.cgi?i ... ppjUfDMmPg

I tried to make a template work: http://mcloz.net/cgi-bin/viewnews.cgi?i ... l=newstemp

And while it picked up the other codes, it ignored my SSI codes. Have I done something wrong? Do SSI codes not work in templates for viewnews? Or are my own codes faulty (definitely known to happen)?

Thanks!
User avatar
Maxine MagicFox
 
Posts: 29
Joined: Fri Jun 04, 2004 4:39 pm
Location: My Fox Den

Postby BJv » Tue Nov 13, 2007 6:16 pm

It seems to me you included a header and other stuff on your index but if you call them seperatly from a different directory the paths of the includes are probably wrong, did you check that?

Also as a suggestion, if you want to have news articles on their own page I would suggest using the maginot addon and making static pages. I've been doing it that way for years check for example: http://www.anotha.com/
BJv
 
Posts: 26
Joined: Fri Jan 26, 2007 4:52 pm

Postby Maxine MagicFox » Tue Nov 13, 2007 6:28 pm

well, that had crossed my mind and I threw some copies of those SSI files into the same directory with the template and viewnews. Still nothing.

Hrrrm, I didn't know about that addon... maybe I should try that though I know nothing about it. ^_^ Thanks, I appreciate it. I'll give it a try later on after work.
User avatar
Maxine MagicFox
 
Posts: 29
Joined: Fri Jun 04, 2004 4:39 pm
Location: My Fox Den

Postby Sebastian » Wed Jan 23, 2008 1:45 pm

Well, actually, I'm having the same problem right now. I use Coranto on a website with over 2 million page impressions per month. Therefore, I use Maginot instead of Viewnews in order to not tax my server.

While using Maginot for current news, I would like to use Viewnews for older news in the archives for them to be as changeable as possible.

I basically copied my working styles and templates from the Maginot installation and tried them with Viewnews. Unfortunately, the SSI's do not seem to work with Viewnews. They work perfectly with Maginot on static (s)html pages.

It would seem kind of odd if it didn't work out eventually since Coranto is explicitly based on SSI's. I mean, it's not as important to be capable of using SSI's with Viewnews than it is with Maginot, but in order to include something like "the 10 latest news" you have to use SSI's.

Has anybody experienced similar problems and could help out?
Sebastian
 
Posts: 8
Joined: Sun Mar 25, 2007 7:33 am
Location: Germany

Postby SrNupsen » Wed Jan 23, 2008 9:23 pm

I searched the forums for you!

Useful info here
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby Sebastian » Thu Jan 24, 2008 10:14 pm

Thank you for the link and your help. :)

I've got to admit that I found the link myself yesterday after some more searching. The Queryfetcher addon is quite nice as a workaround and makes it possible to use SSI's. With it, one can solve the problem to a certain extent.

Theoretically, it would solve my problem, too. But practically, as a next step, I'm now trying to use mod_rewrite in order to have SEO-friendly links and make Google believe that I'm using static pages. Unfortunately, it doesn't seem to work with the Queryfetcher addon.

So I'm having a little dilemma on my hands. On the one hand, the Queryfetcher addon allows the use of SSI's, on the other hand it prevents me from using mod_rewrite.
Sebastian
 
Posts: 8
Joined: Sun Mar 25, 2007 7:33 am
Location: Germany

Postby SrNupsen » Thu Jan 24, 2008 11:02 pm

Hmm.... I can't see why that shouldn't work? I don't know the functionality of mod_rewrite very well, but I would imagine that even if your visitors see http://www.foo.com/nice/link in their browser, http://www.foo.com/viewnews,cgi?id=nice_link would be executed on the server?

Any more info on why that doesn't work? Error messages, anything?
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby Sebastian » Fri Jan 25, 2008 12:02 pm

First and foremost, thanks again for your help, SrNupsen!

I'll try to explain the problem as detailed as I can. If I use Viewnews without the Queryfetcher addon and without mod_rewrite, I have links in the following, well known format:

http://www.site.com/cgi-bin/directory/viewnews.cgi?id=<Field: newsid>&style=newsstyle&tmpl=newstemplate

Afterwards, I use the aforementioned mod_rewrite by creating an easy rewrite rule which looks like this:

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)-(.*)-(.*)\.html$ /cgi-bin/directory/viewnews.cgi?id=$1&style=$2&tmpl=$3


This will generate "fake" links which look like this:

http://www.site.com/EkpEkpklpVKLzDSyGc-newsstyle-newstemplate.html

To present search engines with these links, I change the respective news styles and the way links are created:

<a href="http://www.site.com/<Field: newsid>-newsstyle-newstemplate.html"><Field: Subject></a>

It works like a charm. While I would love to display the subject of each newsitem in the static links, I can certainly live with the above result. The only problem left is the difficulty to include SSI's.


So I try the whole scenario with the Queryfetcher addon instead. My initial links without mod_rewrite look like this:

http://www.site.com/template.shtml?id=<Field: newsid>&style=newsstyle

Like before, I generate a rewrite rule for this one:

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)-(.*)\.html$ /template.shtml?id=$1&style=$2


Then, I once again change the news style like this:

<a href="http://www.site.com/<Field: newsid>-newsstyle.html

In this case, I actually get an error message:

Error. No Parameters given.

Within the template.shtml file, I have included the call to Viewnews:

<!--#include virtual="/cgi-bin/directory/viewnews.cgi"-->

I’m actually not totally surprised that I’m getting an error message, yet I don’t really know how to solve it and whether or not this can be fixed at all.
Sebastian
 
Posts: 8
Joined: Sun Mar 25, 2007 7:33 am
Location: Germany

Postby Musicvid » Fri Jan 25, 2008 2:33 pm

Two Perl modules used independently or together which may give you more control are URI and File::Spec
Musicvid
 
Posts: 138
Joined: Wed Jan 17, 2007 1:05 am
Location: Western America

Postby SrNupsen » Fri Jan 25, 2008 8:28 pm

Then, I once again change the news style like this:

<a href="http://www.site.com/<Field: newsid>-newsstyle.html

In this case, I actually get an error message:

Error. No Parameters given.

Within the template.shtml file, I have included the call to Viewnews:

<!--#include virtual="/cgi-bin/directory/viewnews.cgi"-->


No wonder you get that error. Every time, in template.shtml, viewnews.cgi is called with no parameters, regardless of which URL the user visited.

You need to pass the query string on to the viewnews.cgi call. Perhaps this link can be of some help?
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway


Return to Customization

Who is online

Users browsing this forum: No registered users and 2 guests

cron