Jump to:

5537 Posts in 1737 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Extending extended Pages

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

Page: 1
Go to End
Author Topic: 924 Views
  • eddieconnecti
    Avatar
    Community Member
    26 Posts

    Extending extended Pages Link to this post

    Hi there! Hope anyone can help me with this problem i am stuggling around..

    I have created a Page called "Article" which extends "Page". Works great... I have then created another Page called "Category" which extends "Article" (which extends "Page"). Reason is, i want to have all the special properties of "Article" also inside of "Category".

    The problem is, i cannot create a Category. I tried to change "$can_be_root", but it didn´t affect anything. After hours ... i replaced changed "Article" to "Page", so the "Category" would not longer extend "Article" but "Page". This worked!!? I can then create a Page of Type "Category" in the Root. But as you know, i do not have the same properties as my Article Page has.

    What makes me really diffuse that i have another pagetype called "Event" which i can create and which is also a child of "Article".

    This is the hierarchy for example (Please ignore _ since whitespaces are stripped in the forum). Maybe it explains better what i tried to explain above.

    - Sitetree
    _+- Page
    ___+- Category (working)
    ___+- Article
    _____+- Event
    _____+- Category (not working)

    Can anyone help me please? Any answer may help! Thanks!

  • martimiz
    Avatar
    Forum Moderator
    1078 Posts

    Re: Extending extended Pages Link to this post

    What do you mean by 'can't create'? Does your Category page appear in the create page dropdown in the the left menubar of the CMS? In that case: what happens when you try to create one? Any error messages?

    Is your Event page class-that-works equal to your Category page class-that-doesn't-work in all but the classname?

  • eddieconnecti
    Avatar
    Community Member
    26 Posts

    Re: Extending extended Pages Link to this post

    It happens nothing. "Category" appears in the Dropdown, but if I click "Create", just nothing happens.

    Both classes are not identic, but both extend Article and Article_Controller....

  • martimiz
    Avatar
    Forum Moderator
    1078 Posts

    Re: Extending extended Pages Link to this post

    Something must be wrong in your Category code (since Event works). Did you put Silverstripe in dev mode? Did you try FireBug to look for an error? You could try and build up the Category code anew start with 'empty' classes and go step by step to find where the mishap occurs. I'm sorry I can't be of more help without actually viewing your code, but this should at least get you a bit further...

    924 Views
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.