locked
News Module or new Content Type? RRS feed

  • Question

  • A requirement I've got that I'd like to fulfill with Orchard is to be able to publish news on the site I'm working on. I'm focusing on news right now, like corporate press releases. The question I've got is should this be done as a module or by adding a new content type? Adding a content type is simple, and while a module probably could be done by copying a lot from the blog module, I've got a feeling somebody might be doing this already? It's such a common CMS feature, I mean. On the other hand, maybe nobody is doing it because defining a new content type is the way to go, or they think somebody else it doing it. :-)

    Part of the issue I'll potentially face is this news feature having to be deployed on more than 1 site, and with no way I've seen to export content type definitions, a module appears more fit, but I'm basically just in a place where I just started looking at this CMS and don't want to make any quick decisions that puts me in a bad spot when I'm off to deploy something on several sites. I.e. something that I'll regret, so I'd like any input on the roadmap as to when a content type is appropriate and a module is a better choice. In particular for the scenario above.

    Friday, August 20, 2010 6:21 AM

Answers

  • You can create a module which registers a new dynamic content type like it is done in the Admin, and also add some fields to it. This could be done with only one method in a data migration class, in the Create(). In the future, there should also be a module to export and import some existing types and their configuration.

    Search for AlterTypeDefinition and AlterPartDefinition for examples on how to create dynamic types. You might  also need to add some fields to it, but it's definitely doable.

    For the News modules, you might also find the new ArchiveLater module available on the dev branch. With this module you can define when the news item should be unpublished automatically.

    Sebastien

    • Marked as answer by TomABC Monday, August 23, 2010 9:05 PM
    Friday, August 20, 2010 4:02 PM

All replies

  • You can create a module which registers a new dynamic content type like it is done in the Admin, and also add some fields to it. This could be done with only one method in a data migration class, in the Create(). In the future, there should also be a module to export and import some existing types and their configuration.

    Search for AlterTypeDefinition and AlterPartDefinition for examples on how to create dynamic types. You might  also need to add some fields to it, but it's definitely doable.

    For the News modules, you might also find the new ArchiveLater module available on the dev branch. With this module you can define when the news item should be unpublished automatically.

    Sebastien

    • Marked as answer by TomABC Monday, August 23, 2010 9:05 PM
    Friday, August 20, 2010 4:02 PM

  • I know your post goes back a few years Did you ever find anything - or decide content type / module ?

    Any pointers for me - the only module I have found is closed up code and from a russian company. I would not mind if the code was open for me to view and modify . Any assistance from your experience would be appreciated.

    When you think there is no way, there is a loophole. When you have made it idiot proof, they come out with a better idiot.

    Wednesday, June 28, 2017 7:47 AM