Includes in Viewnews?

Is Coranto not working properly for you? Here's where to ask for support help; for best results, follow these steps:
  • - Check your core/addon documentation for possible solutions
  • - Search these forums for similar problems that have already been solved
  • - If you're still stumped, check out THIS TOPIC, and post your question in this forum!!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

Includes in Viewnews?

Postby BDP » Mon Mar 22, 2004 3:41 pm

I have my site built with includes, to avoid repetitive code. I use these includes for the header and sidebar on every page, including the pages that come up via Viewnews.

Unfortuntaely, since viewnews is a cgi, it's not triggering a process for the includes to be worked into the page.

Is there a way to accomplish this, or must viewnews.tmpl be completely hard coded without includes?

Thanks!
BDP
 
Posts: 116
Joined: Wed Apr 16, 2003 5:10 pm

Postby kriko » Mon Mar 22, 2004 4:09 pm

You can use the same includes as with every Coranto template. It is a typical SSI syntax which I am unable to remember at this very moment :P
Kristjan aka. kriko
now a wireless expert
User avatar
kriko
 
Posts: 3328
Joined: Sat Feb 24, 2007 8:13 pm

Postby Lumberjack » Mon Mar 22, 2004 5:07 pm

You probably have to use <!--#include virtual="path"--> instead of <!--#include file="path"--> (I'm just saying that going from what kriko said, haven't actually used viewnews.cgi myself). Then again I might be way off track.
Lumberjack
 
Posts: 555
Joined: Wed Jan 10, 2007 7:22 pm
Location: Oxford, UK

Postby kriko » Mon Mar 22, 2004 5:42 pm

Depending on the version of Coranto, I checked that the template processing sub in crlib.pl (used by Coranto and viewnews.cgi) supports the following methods of including something:
Code: Select all
<!--#include file="filename.txt"-->
<include file="filename.txt">
<exec cgi="script.cgi">
Kristjan aka. kriko
now a wireless expert
User avatar
kriko
 
Posts: 3328
Joined: Sat Feb 24, 2007 8:13 pm

Postby Parahead » Mon Mar 22, 2004 5:53 pm

I would say that this a perfect case to use the QueryFetcher addon... With that you can make a call to viewnews.cgi from inside a shtml-file and any parameters sent to shtml-file is passed on to viewnews.cgi, so instead of including "fake" SSI inside templates you can use real SSI inside the shtml-page...

An example of this would be:
http://www.parahead.com/tell_a_friend.s ... l_a_friend
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Lumberjack » Mon Mar 22, 2004 8:15 pm

kriko wrote:Depending on the version of Coranto, I checked that the template processing sub in crlib.pl (used by Coranto and viewnews.cgi) supports the following methods of including something:
Code: Select all
<!--#include file="filename.txt"-->
<include file="filename.txt">
<exec cgi="script.cgi">
Ah, that's why it doesn't work, there is no virtual? If not, it definitely should be included in the next build. Unless I have been mistaken all this time, and you can use virtual paths with file.
Lumberjack
 
Posts: 555
Joined: Wed Jan 10, 2007 7:22 pm
Location: Oxford, UK

Postby Parahead » Tue Mar 23, 2004 7:19 am

Lumberjack wrote:
Code: Select all
<!--#include file="filename.txt"-->
<include file="filename.txt">
<exec cgi="script.cgi">

Ah, that's why it doesn't work, there is no virtual? If not, it definitely should be included in the next build. Unless I have been mistaken all this time, and you can use virtual paths with file.
Just want to express my opinion about this. I think it is rather confusing to begin with to have fake SSI-tags parsed by Coranto that uses the same syntax as normal SSI but not really implementing everything...

So instead, the first example above should not be used, but instead something like the two last examples, just to avoid confusion between what is actually processed by Coranto and what is not...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby BDP » Thu Mar 25, 2004 2:42 pm

Thanks, everyone, for your replies. Parahead, your addons rule! I may need to try your viewnews addon, so far, I was trying to do this without it to no success.

I'll tell you where ViewNews is having the problem. With an include statement INSIDE an include. So 2 layers of includes, which work in shtml files, doesn't work with viewnews. Will your viewnews addon fix this?

Right now, two things don't work: My headlines.txt file, which is an include inside my header include file, and the cgi call to display my comment count on the iSay addon.

So in short, it seems viewnews doesn't like CGI/Include calls more than 1 level deep.

But if you think your addon will fix that, I'll try it. :)
BDP
 
Posts: 116
Joined: Wed Apr 16, 2003 5:10 pm

Postby Parahead » Thu Mar 25, 2004 3:00 pm

BDP wrote:Thanks, everyone, for your replies. Parahead, your addons rule! I may need to try your viewnews addon, so far, I was trying to do this without it to no success.
Well, with the current problems I am having to get ShadowMail to work in different environments I wouldn´t totaly agree that they rule... ;-)

BDP wrote:I'll tell you where ViewNews is having the problem. With an include statement INSIDE an include. So 2 layers of includes, which work in shtml files, doesn't work with viewnews. Will your viewnews addon fix this?
Since Coranto processes the style or template, but not the file that you actually include, it only work in one level, that is correct! If you use my QueryFetcher addon and place the calls inside a shtml-page instead where the call to viewnews.cgi is just one among many calls, it would work just fine, because it then *is* a shtml-page and processed by the webserver and not by Coranto... But it will not work if you still have "2 layer includes" in your style/template, since that is *not* the problem QueryFetcher addresses.

Since you seem to know about SSI a bit deeper I hope you understand what I am talking about in my answer and can use that information to accomplish what you want?
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby BDP » Thu Mar 25, 2004 5:47 pm

Hmmm, in that case it doesn't solve my problem.

Guess I'll need to rework my templates to never go more than 1 level deep with an include.

Thanks for the assistance!
BDP
 
Posts: 116
Joined: Wed Apr 16, 2003 5:10 pm

Postby kriko » Thu Mar 25, 2004 5:53 pm

BDP wrote:Hmmm, in that case it doesn't solve my problem.

Yea it will, read his post once again.

You can't have multi level ssi calls in your TEMPLATES or STYLES but you CAN have them on the page which calls viewnews.

Because the page you are including viewnews is shtml file by nature therefore it will be processed as one, including all the includes it calls for and what they call for and so on.

The thing is that the viewnews result can only process one layer itself. But this doesn't matter if you use a plain template and your typical style.

But shtml page including viewnews.cgi will be able to carry all the bells and the rings.
Kristjan aka. kriko
now a wireless expert
User avatar
kriko
 
Posts: 3328
Joined: Sat Feb 24, 2007 8:13 pm

Postby BDP » Thu Mar 25, 2004 6:15 pm

But I tried it and it didn't work.

viewnews.tmpl contains 3 shtml includes that make up the header.

Let's call them header1.shtml, header2.shtml, header3.shtml


They all load fine, HOWEVER, header2.shtml contains this line inside of IT:

<!--#include file="/htdocs/newsdata/headlines.txt"--></TD>

That line is not being processed as it's an include inside an include.

I tried doing it all 3 ways suggested above.

My call to viewnews looks like this:

http://www.site.com/cgi-bin/coranto/vie ... ykHSwFKPUE

Am I missing something?
BDP
 
Posts: 116
Joined: Wed Apr 16, 2003 5:10 pm

Postby kriko » Thu Mar 25, 2004 7:09 pm

Duh. Read the posts above. Your objective is to INCLUDE viewnews.cgi.

Use a truly minimalistic template for viewnews itself, for example:
Code: Select all
<Field: Content>


Use a SHTML page with the include call to viewnews.cgi:

<!--exec cgi="path/to/viewnews.cgi"-->

Check out the queryfetcher plugin.
Kristjan aka. kriko
now a wireless expert
User avatar
kriko
 
Posts: 3328
Joined: Sat Feb 24, 2007 8:13 pm

Postby BDP » Thu Mar 25, 2004 7:17 pm

I think I get it now. I may go back and try it that way.

In the meantime, simply changing my includes around and making sure it never goes more than 1 deep worked as well. :)

You guys are the best. Thanks for all the support. I have another question but I'm gonna start a new thread. Just learning Coranto but it's really versatile and I love it.
BDP
 
Posts: 116
Joined: Wed Apr 16, 2003 5:10 pm

Postby Parahead » Thu Mar 25, 2004 11:04 pm

QueryFetcher is such a simple addon but I have come to the conclusion that the tricky part with it is to really explain what it does! :lol:
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Next

Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 0 guests