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 How To Remove ShortStory from FullStory display.
Rayc
Posted on 17 Jun 2010, 16:24:21

Access: Member
Total Posts: 74
Joined: 2010-06-13

I've searched through the various threads, but haven't found a satisfactory answer:

Is there a way to have shortstory removed from the Full Story display?

If I use [readmore] {shortstory} [/readmore], the entire short story becomes a link (which is OK, I guess), but it is also displayed with the full story.

The only other answer involved a lot of editing of the script, which I'd like to avoid as I'd hate to mess up this wonderful script.

Can this be done?

Thanks,
-RayC
#2517
Chris
Posted on 25 Jun 2010, 16:56:09

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

This could be achieved by creating another template that only displays the full story and using a bit of code to switch the template when viewing a full article, so something like.

Code:
<?php
if($_GET['id']){
    
// viewing a full article use full story template
    
$template = 'fullstory';
}else{
    
// not viewing a full article, use the normal template
    
$template = 'news';
}

include 
'news/index.php';
?>

#2547
Pirana
Posted on 25 Jul 2010, 05:32:18

Access: Member
Total Posts: 3
Joined: 2010-07-24

could you explain in more detail please :lol:

I fail to work
#2764
Davidmcc3
Posted on 07 Feb 2011, 20:34:32

Access: Member
Total Posts: 20
Joined: 2009-08-13

Chris - is this something you can elaborate on? Not knowing php, I'm completely lost when trying to work out how to remove the short story when the full story is displayed.

On a similar subject, I've added a link to get back to the full list from the long story, but can't work out how to have this display only when the long story is shown.
#3176
Chris
Posted on 12 Feb 2011, 09:54:08

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

Using the above code

Code:
<?php
if($_GET['id']){
    
// This means you are currently viewing the a single article, the full story
    // So what you want to do is assign a different template to be used
    // In this example we've named the template 'fullstory'
    // If you edit/create that template via Options > Templates
    // So that there is no {summary} tag in the 'News' section then the
    // Summary should no longer show when viewing the full article
    
$template = 'fullstory';
}else{
    
// This means that we're currently not viewing a single article so we don't
    // Need to change the template. So either specify which template to use below
    // Or remove the $template = '' line completely.
    
$template = 'news';
}

include 
'news/index.php';
?>
#3188
Rayc
Posted on 12 Feb 2011, 19:21:48

Access: Member
Total Posts: 74
Joined: 2010-06-13

Hey, Chris. Welcome back. :lol:

Isn't this issue moot with version 4?

I thought that was what the following from the Wiki is for:

Quote:
<?php $news_layout = '0';
// How the articles are shown when not viewing a single post
// 0 = default, shows article, if post has a summary shows it instead
// 1 = Show summary only
// 2 = Show article only
// 3 = Show summary and article

$comments_layout = '0';
// How the articles are shown when viewing a single post
// 0 = Show both article and summary
// 1 = Show summary only
// 2 = Show article only include 'news/index.php'; ?>

Format how your news articles get displayed using the above variables.
#3192
Chris
Posted on 12 Feb 2011, 19:44:52

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

Ya you're pretty much correct. There are a lot of different ways to achieve this, the one I mentioned above is just one of them.
#3193
Network-13.com © 2013