You are right, there is still no fluent api for that. We have plans to have this too :)
Actually the fluent API is there but it is not visible at this level for this facade. You may add controls on page creation:
//create new page, working with Page facade
.Do(p => p.Name =
//access to Control facade
//Create new Control, working with Control facade
.Do(c => c.Caption =
"My New Control in placeholder1"
.Do(c => c.PlaceHolder =
//Exit the Control facade, we are now back to Page facade
"My New Control in placeholder2"
//Exit the control facade
//will be called for the page facade
Let me shed some light on the pages API. Actually the CreateNew(...) method is meant to be protected and I guess the example that Georgi wrote is a bit older. You should call CreateNewStandardPage() or CreateNewPageGroup() method to create new page. We are going to also introduce external page soon. The reason these are separate methods is because they return different facades. Although, in both cases we are working with page nodes both have very different characteristics, for example controls don't make sense for page groups.
Here is the correct code:
// returns standard page facade
"My Test Page"
// creates a draft vresion and locks the page
// the fluent API allows adding conrols only to drafts
Label() Text =
"My Test Label"
Be aware that currently there is no easy way to control the order of the controls within a place holder with the API. This is due to the fact that the controls in a place holder can be mixed with controls coming from a chain of inherited page templates. Sitefinity allows you to insert controls between controls defined in a base template. Currently we rely on the UI layer to get information about the siblings of a control, but we are going to move this logic to the fluent API.
I hope this can help you better understand our ideas. We are open for suggestions and now is the best time for discussing the API design.
the Telerik team
We'll have this in the Dev. Manual by the end of the week!
Sorry for the inconvenience.