5121 Posts in 1527 Topics by 1119 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 567 Views |
-
Manipulate AddPageOptionsForm in CMS

19 March 2011 at 12:54am
Hi,
I'm looking into changing the default selected option in AddPageOptionsForm for creating new pages.
Is this posible to set in (php) code? I tried some JQuery but that didnt work out.
Behaviour.register({
'#Form_EditForm' : {
initialize : function() {
this.observeMethod('PageLoaded', this.adminPageHandler);
this.adminPageHandler();
},
adminPageHandler : function() {jQuery("#Form_AddPageOptionsForm_PageType option")
.each(function() {
if (jQuery(this).val() == 'DefaultSelectedPage')
{
jQuery(this).attr('selected', true);}
});}
}
}); -
Re: Manipulate AddPageOptionsForm in CMS

30 March 2011 at 11:41pm
Hi Bart,
I think if you add this to your Page class it should do the trick:
static $default_child = 'DefaultPageClass';
Aram
-
Re: Manipulate AddPageOptionsForm in CMS

1 April 2011 at 10:10pm
Hi Aram,
Thanks, I'll try that out as well.
In the end i managed to do this by doing it with javascript (jQuery) ::required by LeftAndMain.
[[PageTypeToBeDefault]] is the default page.Behaviour.register({
'#Form_EditForm' : {
initialize : function() {
this.observeMethod('PageLoaded', this.adminPageHandler);
this.adminPageHandler();
},
adminPageHandler : function() {jQuery("#Form_AddPageOptionsForm_PageType option")
.each(function() {
if (jQuery(this).val() == '[[PageTypeToBeDefault]]')
{
jQuery(this).attr('selected', true);
}
});}
}
});Bart
| 567 Views | ||
|
Page:
1
|
Go to Top |


