Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

News module or extension


Go to End


17 Posts   10290 Views

Avatar
sabumnim

Community Member, 3 Posts

5 January 2011 at 8:45am

Hi all

I was gazing through the extensions the other day in hopes of finding some sort of News module or extension for silverstripe.

However I never stumbled upon anything.

Are there any modules that would/could be useful as a news module and how do they work, are there any tutorials on them, in any exists?

//Carsten - Denmark

Avatar
bartvanirsel

Community Member, 96 Posts

5 January 2011 at 9:37am

Hi!

I would advice to create a NewsHolder and NewsArticle pages as also described here: http://doc.silverstripe.org/tutorial:2-extending-a-basic-site

I think there is no module because this is very similar to the Page class in Silverstripe which is
placed in a holder. The Holder Page shows the news by date (new-old) with a link to the detail news article.

Hope this helps a bit.

Avatar
Marcus

Administrator, 89 Posts

6 January 2011 at 11:59am

I have a news module available at http://github.com/nyeholt/silverstripe-news which you might find useful. It's not completely documented at all, but is usable in its current state.

One nice feature is that it will perform automatic 'filing' of articles in a date based tree. Typically, you create a top level "News" page of type News Holder, and check the 'automatically file articles' checkbox. After this, create news articles by selecting that News page, and creating a news article as a child - a date based hierarchy will be automatically created beneath that with relevant names, so you should end up with a hierarchy like

/news
/2011
/jan
/06
/article-title

Each part of the hierarchy will automatically create an 'archive' type view, so viewing /news/2011/jan will list all the days beneath it and their articles.

Anyway, if you want to give it a go, I'll be happy to answer questions and fix anything you need to get working :)

Avatar
Terry Apodaca

Community Member, 112 Posts

2 March 2011 at 1:39pm

@Marcus using your module right now. I like it so far! I'll be sure to come back with some feedback!

Avatar
Marcus

Administrator, 89 Posts

2 March 2011 at 1:42pm

@Terry Make sure you grab the latest version (committed about 12 hours ago) that fixes a few bugs when creating a new article in a new month. All feedback welcome :)

Avatar
Terry Apodaca

Community Member, 112 Posts

2 March 2011 at 1:44pm

I've already installed it a week ago...I should be able to just lay the new version on top of that right?

then run /dev/build?flush=1

I have noticed when creating a new article and you have the 'Archive' turned on, it creates the new article under the main tree...

Avatar
Marcus

Administrator, 89 Posts

2 March 2011 at 2:59pm

Yep, should just go over the top

It doesn't actually create it there, it just appears under the main tree due to the tree not having the new parent exposed (or it might not even exist until after the article is created). I've been considering making it automatically expand down the tree to the new point, but it's a somewhat handy side-effect having it directly available in the tree (it then appears to be 'filed' later).

Avatar
Terry Apodaca

Community Member, 112 Posts

2 March 2011 at 3:34pm

Edited: 02/03/2011 3:56pm

Makes sense!

Next thing I have noticed...there is a HtmlEditorField for "Article Summary (displayed in listings)" but it's never used in your default templates. Even though it says it is displayed in the listings (I assumed it was probably the NewsHolder template for the list of News Articles. I looked in the templates and it uses

$Content.Summary(50)

When in my opinion it should just be

$Summary

Just a little confusing to the end user because that field never shows up in the default templates until the actual News Article (NewsArticle.ss). I know that's nit picky...and it's a templating issue that's easily solved, but out of the box it could be a bit confusing. I wouldn't expect to see the summary on the main article page....seems redundant.

Also found this in the template NewsListItem:

<% if Thumbnail %>$Thumbnail.SetRatioSize(50,50)<% end_if %>

but haven't seen a place in the CMS to load a thumbnail or even a news article photo. I've just been adding them into the Content section of the CMS for each article. Not sure if thats new and hasn't been fully integrated yet. I didn't notice this a week ago.

Go to Top