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.

Customising the CMS /

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

Another way to implement PageType. Is it possible?


Go to End


3 Posts   1252 Views

Avatar
Dramew

Community Member, 9 Posts

14 December 2010 at 4:18am

When I want to implement some new feature and let user (content editor), for example, create forms on his page, I can write new Page Types or use modules, which implement those Page Types. And user can then select in the Behaviour tab - page type of current page. But what if I want, for example, to let user be able to create his UserDefinedForm, Gallery and smth else on the same page. As I understand, I have to create new page type which will be able to handle all those things.

I am not a great PHP developer (so I do not know is it hard to implement), but wouldn't it be better and easier for content editors to be able to "Add new features to page" rather than select "PageTypes". Because, at some point there can be a lot of page types, with which it is not easy to work. And if user could "Add new features to page" (for example, I want to insert some form into current page, then I have just to to "enable" this feature and new tab will appear in which I can define my new form), it would a lot more "UserFriendly".

Is it possible at this moment?

Avatar
Willr

Forum Moderator, 5523 Posts

14 December 2010 at 6:14pm

While it would be easier for content authors it would be challenging from a backend development. The thing about page types is that you can define your datamodel (i.e fields) and you can write your templates to use those fields. If this was all up to the user then it would be near on impossible to build anything more than a simple website. Imagine if you wanted a page type with a image field, you would require the user to add this feature but then how do you update the template based on each combination of things people could add.

It would require a major overhauling of the entire framework to support something like that and would require a lot of configuration / design around it since you would want a mix of user controllable extensions.

Would make a nice client facing tool but probably not suitable for the core cms.

Avatar
Dramew

Community Member, 9 Posts

14 December 2010 at 10:36pm

Thank you for the quick answer Willr.
I can imagine that it is not easy to make such system. But what I mean is: when we create new page type we can inherit properties from ancestor page type; so it seems like I can create a page type which will implement different features and then let the user choose what features he wants to be enabled and which disabled.
I think I have to look at this deeper myself, because maybe I do not understand smth clearly at this moment about possibilities of cms.
But anyway thank you for the answer. Silverstripe is really great and all this is just my thoughts about how to make it even better =)