NAME
SCALP::News - The default News template that comes with SCALP
VERSION
Version 0.0.3
SYNOPSIS
Create a news type page and add, edit, and present entries.
The object returned is a hash references that has an array called 'entries' in which it saves the entries.
use SCALP::News;
my $newspage = SCALP::News->new( name => 'News' );
or even:
my $newspage = SCALP::News->new(
title => 'News',
preentry => '<p>',
postentry => '</p>',
);
this sets up the preentry and postentry variables.
FUNCTIONS
new
Creates an object of SCALP::News. Can accept any argument given and adds it.
$news = SCALP::News->new;
It's best the give them names and/or ids to keep track.
The object returned is a hash references that has an array called 'entries' in which it saves the entries.
for example:
print "All news entries:\n";
map {
print "Entry no. $_: ";
print $news->{'entries'}->[$_]->{'title'}
print "\n";
print "Content: ";
print $news->{'entries'}->{'content'};
print "\n\n";
} @{$news->{'entries'}};
add_entry
Adds a news entry to the page.
Returns the ID of the entry. The ID is manufactured internally and helps you reach the entry faster.
my $id = $news->add_entry;
or
$id = $news->add_entry( title => 'Vacation!', content => 'I am going on vacation! Whee!' );
title
Sets the title of an entry with the corresponding ID
Returns the Title for an ID
$news->title($id, 'Vacation! - Well, not really...');
or
print "The title of ID #", $id, "is ", $news->title($id), "\n";
content
Sets the title of an entry with the corresponding ID
Returns the Content for an ID
$news->content($id, 'My vacation was cancelled!');
AUTHOR
Sawyer, <xsawyerx at gmail.com>
BUGS
Please report any bugs or feature requests to bug-scalp-news at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SCALP. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc SCALP
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
RT: CPAN's request tracker
Search CPAN
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2007 Sawyer, all rights reserved.
This program is released under the following license: GPL v2 or later