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 Showing headlines
1 2 3
Welli
Posted on 03 Dec 2009, 12:23:06

Access: Member
Total Posts: 12
Joined: 2009-11-21

Hey!

Is it possible to embed only the headlines on eg. your website frontpage so it would auto update latest headlines to this site, instead of only displaying it on the news site?
#1236
Chris
Posted on 03 Dec 2009, 13:52:58

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

All you need to do is create a new template that displays only the headline and not the story, then use that template when displaying your news on the front page.

Code:
<?php
$template 
= 'headlines';
include 
'news/index.php';
?>
#1237
Last edited by Chris at 2009-12-03 19:13:05 Reason:
Welli
Posted on 03 Dec 2009, 18:47:46

Access: Member
Total Posts: 12
Joined: 2009-11-21

Hey.

It dosn't seem to work - when i include:

<?php
$template 'test';
include 'news/index.php';
?>

It dosn't work - the page isn't loading, and only a white page with nothing on it is displayed in the browser, but if i insert

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

it displays all news like it normally would - what seems to be the problem ?
#1242
Last edited by Welli at 2009-12-03 19:02:10 Reason:
Chris
Posted on 03 Dec 2009, 19:13:48

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

I forgot to add a = symbol in my previous post, it should look like this

Code:
<?php
$template 
= 'headlines';
include 
'news/index.php';
?>
#1243
Welli
Posted on 06 Dec 2009, 18:31:54

Access: Member
Total Posts: 12
Joined: 2009-11-21

Thanks - it worked! However, Is it possible to show more headlins with one template than another? I would like to have eg. 8 "Latest news headlines" on the front page, but on the actual news page i would like for only 4 news to appear.

Furthermore, if i get the headlines from one my frontpage to link to my actual news page:

<div style="font-family: Tahoma; font-size: 10pt"><a href="http://www.mydomain.com/my-news.php">{title}</a>

the links are underlined - is it possible to make them "not underlined" ?

I look forward to hear from you mate :)

#1252
Last edited by Chris at 2012-03-07 18:05:46 Reason: Formatting
Chris
Posted on 06 Dec 2009, 19:00:28

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

You can specify the amount of news you want to show with each include like so

Code:
<?php
$nppage 
= '4'; #show 4 news posts
$template = 'headlines';
include 
'news/index.php';
?>


You can change the formatting of your links with a bit of css, for your links add a new class to them like so

Code:
<a href="http://domain.com/my-news.php" class="nounderline">{title}</a>


then in the css of your webpage add this

Code:
.nounderline {
text-decoration: none;
}

#1253
Chris
Posted on 06 Dec 2009, 19:05:45

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

Also, instead making your headline links redirect to the actual news page, how about making them redirect to the news page then show the news post the user just clicked on. You can do that using this

Code:
<a class="nounderline" href="http://www.mydomain.com/my-news.php?id={id}">{title}</a>


notice the id={id}, this is what will make it show the news post
#1254
Jason
Posted on 19 Dec 2009, 05:55:47

Access: Member
Total Posts: 6
Joined: 2009-12-19

hey, i'm pretty clueless when it come to this sort of stuff...
how would i do something similar to what you just said - i want the headlines on the homepage of our club, then when you click on them, i'd like it do go to another version of the site - one without the ads etc that are on the homepage. is this possible?

thanks, Jason.
#1289
Chris
Posted on 19 Dec 2009, 16:22:36

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

Jason,

First you need to create new template, Options > Templates > Create a new template.

In the News section of the template this is where you put the html code you want to use when displaying your headlines. Put something like this

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


Save this template and call it Headlines.

Now on the actual page where you want to display the headlines add this code

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


This will then show your headlines as links that when clicked will redirect to the fullstory.php page that you specified in the template.

Now all you need to do is edit fullstory.php and put a normal include in that page like so

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


So when a user clicks on one of the headline links on the front page, they get sent to the fullstory.php page which then shows them the full story for the headline they just clicked on.
#1292
Jason
Posted on 20 Dec 2009, 03:12:01

Access: Member
Total Posts: 6
Joined: 2009-12-19

thankyou my friend - YOU ARE AWESOME!
#1306
1 2 3
Network-13.com © 2013