21300 Posts in 5735 Topics by 2603 members
General Questions
SilverStripe Forums » General Questions » how to start dev/build from cms after creation of a new Class (PageType)
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 946 Views |
-
how to start dev/build from cms after creation of a new Class (PageType)

21 March 2011 at 9:10am
Hi,
I'm creating new Classes (PageTypes) in the cms and want to rebuild the db after saving the new class to mysite/code to
publish the new class.
The Classname-Field of the SiteTree-Tables needs to be updated to add the new PageType-ClassI foud DB::beginSchemaUpdate() but I dont know if it does the right action and if yes, how to do it ??
THanks in advance for any advice
Salut
Lukin -
Re: how to start dev/build from cms after creation of a new Class (PageType)

21 March 2011 at 1:36pm
Don't you just want to do a dev/build?
If so then just type:
http://[siteaddress]/dev/build/
-
Re: how to start dev/build from cms after creation of a new Class (PageType)

21 March 2011 at 2:40pm
yeah.. Like ampedup said..
Try the default silverstripe db re-build url.[domain_name/dev/build]
-
Re: how to start dev/build from cms after creation of a new Class (PageType)

21 March 2011 at 11:52pm
hi again,..
I'm creating the classes on the fly in one of my onAfterWrite-Events in ModelAdmin and need
to update SiteTree /live/version without typing any url. It has to happen in the background... -
Re: how to start dev/build from cms after creation of a new Class (PageType)

22 March 2011 at 12:48am
Hi Lukin,
Why do you want to create classes on the fly from the CMS?
-
Re: how to start dev/build from cms after creation of a new Class (PageType)

22 March 2011 at 1:17am
well
I'm building some kind of catalogue which is organized in serveral categories an subcategories. These categories are managed in a modeladmin. The catalogue itself is managed in the Pages - sitetree, like normal pages. Now if the user adds a new category in modeladmin, I need to create a pagetype (pagetype-class) wich represents the new category in sitetree... Although I'm creating a new ss-template for each category...
This might be a bit complicate but seems to be the most userfriendly solution for my needs, ... -
Re: how to start dev/build from cms after creation of a new Class (PageType)

22 March 2011 at 11:23am
Cool.
I would have the categories as just a field in your page. Looking at your description there are going to be no structural differences between the pages that have different categories. In that case there is no need to create new page types. Just have a dropdown to select which category the object is. This dropdown can still be generated from a list you create in modeladmin.
I don't think it's possible to create new page types on the fly like this. To the best of my knowledge, you need to physically write the php code to define the classes you want.
-
Re: how to start dev/build from cms after creation of a new Class (PageType)

22 March 2011 at 12:45pm Last edited: 22 March 2011 1:08pm
HI,
well, there are some differences,.. subcat of cat musn't show all pages of cat and sub1 of cat has diffrent pages than sub2 of cat...
subsub extends sub extends cat....I thought about the dropdownsolution aswell, but I want to do it autmoatic, so the user doesn't have to configure which type of pages he needs to create.
Steps:
1. Creating new Categroy in ModelAdmin ... onAfterWrite:
2. Writing new Class-File with the name of the new category to mysite/code
3. [unsolved] Rebuilding database or better only rebuilding the sitetree-tables
4. Creating new Page with my new PageType into SiteTreeWith the target to get these dataobject 'multilevel-structure' displayed as pages( and subpages, or categories/subcategories) in SiteTree
hope you got me....
I'm not very familiar to write in english
| 946 Views | ||
|
Page:
1
|
Go to Top |



