How to add an include

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

How to add an include

Postby Digicamhelp » Sun Jun 17, 2007 12:10 am

The person who developed my website is unavailable so I'm hoping someone here can help me. Trying my best to set up something at my own site that I don't fully understand.

My site uses Coranto v1.24 with a wysiwyg editor. I'd like to add a Google text link ad into some of my articles but the editor doesn't take kindly to javascript. I insert the code in html mode and it disappears.

About a year ago, I was told to use an include. Well, I've made the include but it's been so long that I don't recall how to get the contents of an include to display in an article.

The following image illustrates where some includes are located that I can access via a FTP client. They are not currently being used so I can't take a sneak peek at the code to figure this out.

Image

Here's the link if the image doesn't display.


http://i.pbase.com/o6/14/358814/1/80634 ... nclude.jpg

I'd appreciate if someone can clarify how to get the include to display in text in an article. Please let me know if I haven't explained myself clearly.

Thank you.
Digicamhelp
 
Posts: 17
Joined: Sun Jan 21, 2007 3:14 pm
Location: USA

Postby Jackanape » Sun Jun 17, 2007 12:18 pm

From corantodemo.net:
http://www.corantodemo.net/doc/overview.shtml
Using SSI or PHP to display your news

Incorporating the content into an existing page. If you want to insert the content created by Coranto into an existing page you can use SSI (Server Side Includes). Most servers use the .shtml extension for pages that will be procesed for SSI. A different extension is used so that the server won't process files without includes saving time and resources.

Assuming that the page you want the content inserted into is in the same directory on your server you would place:

<!--#include virtual="news.txt" -->

in the page where you want the content at. When the page is viewed your server will replace this command with the content of the news.txt file.

Note: Some servers require that the space before the --> be removed for the #include to work.

Here is what the item entered above looks like included in this page:

My First Item -- Posted by test on Thursday, February 17 2005
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit a
Powered by Coranto

Displaying the same file in a php page could be done with this code:
<?php include("../_news/test_news.txt");?>

Most servers require the .php extension for files that use php code.

Any method you are currently using to include text files into your web pages will work with the files created by Coranto, since they are just text files themselves.
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby Digicamhelp » Sun Jun 17, 2007 5:55 pm

Thanks so very much. No matter what, I just can't get it to work.
Digicamhelp
 
Posts: 17
Joined: Sun Jan 21, 2007 3:14 pm
Location: USA

Postby Jackanape » Mon Jun 18, 2007 12:38 am

It's still not working?

Are you using an SSI include? You'd need to make sure your page is saved with an .shtml extension.

Php include is a little more self explanatory...name the file a .php file.

How are you actually typing your include?
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby Digicamhelp » Mon Jun 18, 2007 4:40 pm

>>Are you using an SSI include? You'd need to make sure your page is saved with an .shtml extension.

The way it worked before, all I had to do is create a text file with the code. I just don't recall the snippet used to bring it into the content.

I tried the following with both 600.php and 600.txt. Nothing works.

<?php include("../incs/google-ads/600.php");?>


Thanks for the help but I am way in over my head.

I'm seriously thinking of having my site taken out of coranto. I haven't been able to find one qualified, competent web developer, other than the person who created it, who can work on it.
Digicamhelp
 
Posts: 17
Joined: Sun Jan 21, 2007 3:14 pm
Location: USA

Postby Jackanape » Mon Jun 18, 2007 6:10 pm

Digicamhelp wrote:>>Are you using an SSI include? You'd need to make sure your page is saved with an .shtml extension.

The way it worked before, all I had to do is create a text file with the code. I just don't recall the snippet used to bring it into the content.


So, in other words, you weren't using Coranto at all? I'm confused a bit.

I tried the following with both 600.php and 600.txt. Nothing works.

<?php include("../incs/google-ads/600.php");?>

Well, this part is easy.
1) All the files in your list above are .txt files. So that has to be the extension.
2) I presume you're building a new page. If you're using the php include it MUST be a .php page, not .html, or .htm, or even .shtml.
3) If it still doesn't work, your permissions may be incorrect on the files you're trying to include.

I am really in over my head.

I'm seriously thinking of having my site taken out of coranto. I can't find one qualified, competent web developer, other than the person who created it, who can work on it without a huge learning curve.

Not for nothing, but Coranto carries the lowest learning curve of any CMS I've ever seen, and has twice the capability.

A big problem we're having here is that we don't have enough information. Are you adding a whole new category to Coranto, or is this just an include issue, as it seems, is it a new page you're making, what's the extension of the page you're making, can you provide a link to the page, so we can see it, and get an idea as to what you're talking about? Oh, what sort of error message are you getting?

See what I mean?
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby Digicamhelp » Mon Jun 18, 2007 6:38 pm

<<So, in other words, you weren't using Coranto at all?

I am simply trying to hyperlink a word within text so when a person clicks on it, it will take them to Google Pack. The hyperlink would include my affiliate number, so I would get credit for any sales. The code looks like this:

<script type="text/javascript"><!--
google_ad_client = "pub-myaffliatenumber";
google_ad_output = "textlink";
google_ad_format = "ref_text";
google_cpa_choice = "CAAQ3KfzygIaCNJbQ5r5YiDXKKjntoQBMAA";
google_ad_channel = "";
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


Previously, I was able to simply paste in a snippet of code with the file name of the include, and an ad would appear within the text of an article. It is about a year since I used the code snippet and no longer recall it.

So no, I am not trying to build a new page but insert a hyperlink for an affiliate product. Hope I'm explaining myself more clearly.


< Not for nothing, but Coranto carries the lowest learning curve of any CMS I've ever seen, and has twice the capability.

Well I've asked a number of qualified people to make some minor changes to my site, gave them entry to the back end to take a look, and no one wants to touch it. Maybe I need to make a request in the appropriate forum here.

Anyway, here is a page containing a hyperlink to an affiliate product by Boxwave. I want to be able make a similar hyperlink using Google's code but it requires a JavaScript call.

http://www.digicamhelp.com/blogs/cool-s ... tector.php

>what sort of error message are you getting?

I'm not getting an error message. The link simply does not appear in the article, though the code is in html view.
Digicamhelp
 
Posts: 17
Joined: Sun Jan 21, 2007 3:14 pm
Location: USA

It works here

Postby Digicamhelp » Mon Jun 18, 2007 11:14 pm

I inserted the same Google code in a page at my daugther's site that I created with FrontPage. It took me all but five seconds and it works!!!!

http://thebeadholder.com/gtest.htm

But suppose I didn't know how to do this. I could go to any number of webmaster forums and get help, even able to hire someone to do it for me. I seem not to be able to do that using Coranto.

Thanks again.
Digicamhelp
 
Posts: 17
Joined: Sun Jan 21, 2007 3:14 pm
Location: USA

Postby Jackanape » Tue Jun 19, 2007 4:36 am

OK, I have a better idea of what you're trying to do now, and I'm baffled as to why it won't work for you, since the earlier ones do seem to work just fine. As a general rule, the code you insert into a Coranto newsfield should be parsed properly by the reader's browser. That this code isn't getting parsed--while the rest of your article is--seems strange, and could lay in your original designer's configuration...

If you'd like, I'd be happy to take a look at the back end of your installation to see if I can spot the problem...let me know.
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby Digicamhelp » Tue Jun 19, 2007 12:31 pm

Jackanape wrote:
If you'd like, I'd be happy to take a look at the back end of your installation to see if I can spot the problem...let me know.


Thank you SO very much for the offer. I will contact you a bit later today by email or PM.

:D :!:
Digicamhelp
 
Posts: 17
Joined: Sun Jan 21, 2007 3:14 pm
Location: USA

Postby Digicamhelp » Tue Jun 19, 2007 5:16 pm

Here's the code that resolved the problem:

[include]/incs/google-ads/600.txt[/include]

Thanks again for all the help. I appreciate it very much.
Digicamhelp
 
Posts: 17
Joined: Sun Jan 21, 2007 3:14 pm
Location: USA


Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 3 guests

cron