Hi!! I really like this news script!!
I only have one problem. In one of my pages I want to change the template to one i made myself to show the news in fulltext. But when i make the include i get the standard (default style template instead...
Here is the code im using.
<?php
$template = 'Plain style';
include 'http://www.myhomepage.se/U2/news/index.php'; #example 'news/index.php';
?>
What is the problem here do I need to do anything else??
Access: Admin
Total Posts: 1395
Joined: 2006-05-19
Quote:
Hi!! I really like this news script!!
I only have one problem. In one of my pages I want to change the template to one i made myself to show the news in fulltext. But when i make the include i get the standard (default style template instead...
Here is the code im using.
<?php
$template = 'Plain style';
include 'http://www.myhomepage.se/U2/news/index.php'; #example 'news/index.php';
?>
What is the problem here do I need to do anything else??
The problem seems to be the code you are using to include the news
Code:
$template = 'Plain style'; include 'http://www.myhomepage.se/U2/news/index.php'; #example 'news/index.php';
try removing the first line, then whilst logged into the system, goto Options>Templates and select the template you wish to use as default.
I found one bug in the templating, but it might not be what is your problem directly. When you create a duplicate template from the original, the last two fields (News Structure and Comments Structure) in the template editor do not get copied over.
I haven't researched why it isn't copying over or what these two fields really do for the template, but it was something I noticed which fixed my custom template to allow it to work.
Now my resolution doesn't quite answer the original question but it definitely goes hand in hand if creating a new one and it doesn't work properly. The code he supplied looks ok, other than verifying if things were spelled properly.
Hope this helps someone even if it isn't quite the full solution.
-Sam
Sweet script by the way.