Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support setting templates as default
Alankeys
Posted on 24 Dec 2009, 17:23:30

Access: Member
Total Posts: 107
Joined: 2009-11-28



In the template system it is necessary to set one template as default.

If using template system to create hyperlink lines (typical newsreel), a headlines template is created and selected as default.


Then all RSS feeds point to headline template and not a story.

Please clarify user misunderstanding of how this should be set-up.

#1359
Chris
Posted on 25 Dec 2009, 02:16:00

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

You select 1 template as the default template, this gets used for display your news if you don't manually specify a template in the include code.
#1361
Alankeys
Posted on 26 Dec 2009, 10:33:35

Access: Member
Total Posts: 107
Joined: 2009-11-28


i created a headline newsreel using

<?php
$template = "headlines";
include './news/index.php';
?>

the result is list of hyperlink article headlines.


On clicking link, opens article page but the content still calls "headlines" template.



im sorry, i know im being really thick but I cant see how to call the "article template" eg "3.3 Ajax Template"

could you indicate what it is that I am missing ?
#1377
Chris
Posted on 26 Dec 2009, 10:38:33

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

When you specify a template in your include code, when you then click on one of the headlines that include generates, the page refreshes and shows that particular article, because you're on the same page which has the same include you're still assigning the template to it that you've specified.

So what you need to do is make your links redirect to another page that has an include on it, but doesn't have the $template variable specified.

So for example, this is your headlines include

Code:
<?php
$template 
= "headlines";
include 
'news/index.php';
?>


The code for that headlines template change to something like this

Code:
<a href="fullstory.php?id={id}">{title}</a>


This will make the headlines show and once clicked it'll redirect to the page "fullstory.php"

Then on the fullstory.php page create a normal include but don't specify a template like so

Code:
<?php
include 'news/index.php';
?>


What will happen now is, on your headlines page, users will see the headlines, click on one, get sent to fullstory.php, on this page it'll display the full article and use whatever is the default template.
#1378
Last edited by Chris at 2009-12-26 10:44:22 Reason:
Alankeys
Posted on 26 Dec 2009, 10:48:35

Access: Member
Total Posts: 107
Joined: 2009-11-28

Chris

I understood this !

Executed, solved and working.


Thanks very much.....
#1379
Alankeys
Posted on 27 Dec 2009, 10:48:51

Access: Member
Total Posts: 107
Joined: 2009-11-28

Chris

Will friendly URLs work in this arrangement ?
Friendly URL doesnt seem to pass ...
#1396
Chris
Posted on 27 Dec 2009, 10:50:37

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Friendly URLs won't work with this setup.
#1397
Alankeys
Posted on 27 Dec 2009, 11:07:53

Access: Member
Total Posts: 107
Joined: 2009-11-28

Ok. Thanks Chris
#1398
Network-13.com © 2013