Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » A few (basic) questions on building a module

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

Page: 1
Go to End
Author Topic: 704 Views
  • Mad_Clog
    Community Member
    78 Posts

    A few (basic) questions on building a module Link to this post


    I made a News module (to get to know SilverStripe better) which is largely based on the Article tutorial.
    Few things I'm stuck at and would appreciate some help with:

    I've added pagination to the module, however the urls of the pagination pages are in the form off /news/?start=5
    How would one go about transforming those urls into something like /news/5/.
    On IRC someone mentioned $url_handlers, but i can't seem to figure out how this works, nor do i know if this is the proper approach.

    All the module files are located in a folder called "News" which is located in the site's root.
    This way I can easily implement the module on various sites.
    However if i would want to extend the base functionality (say add a field, or change a field's type, make a field mandatory, etc etc), how would this be done.
    Normally you would extend a class, but then wouldn't I end up with a "NewsArticle" page type AND a "CustNewsArticle" page type?

    Lastly, how do you make a field obligated in the backend?
    For example with the News module i added a PublishDate field on top of the "Page"'s field, now i would like that field to always to be filled in.

    Any help would be appreciated here.
    Thanks in advance!

    Kind regards,

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.