<![CDATA[ [Tips] Enchancement on Document Template Select Box - My Forums]]> https://forums.modx.com/thread/?thread=19697 <![CDATA[Re: [Tips] Enchancement on Document Template Select Box]]> https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109415 ]]> rethrash Mar 11, 2006, 02:09 PM https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109415 <![CDATA[Re: [Tips] Enchancement on Document Template Select Box]]> https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109414 http://modxcms.com/forums/index.php/topic,1092.0.html

Thanks netnoise, now that explains the global variables thing. Man, I never get use to those global variable thing in PHP. It’s SO CONFUSING, lol.

Anyway, forget about the hack!]]>
wendy Jan 17, 2006, 02:47 PM https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109414
<![CDATA[Re: [Tips] Enchancement on Document Template Select Box]]> https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109413
Thanks]]>
wendy Jan 17, 2006, 02:37 PM https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109413
<![CDATA[Re: [Tips] Enchancement on Document Template Select Box]]> https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109412 MARKSVIRTUALDESK Jan 17, 2006, 02:00 PM https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109412 <![CDATA[Re: [Tips] Enchancement on Document Template Select Box]]> https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109411 and could some stander most used modules/plugins/snippets be shipped with the next release?

i use the png plugin on every site I make now i need to intall it by hand all the time and the .... sorry drifting of here its off topic.

Dimmy]]>
Dimmy Jan 17, 2006, 11:34 AM https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109411
<![CDATA[Re: [Tips] Enchancement on Document Template Select Box]]> https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109410

]]>
rethrash Jan 17, 2006, 11:23 AM https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109410
<![CDATA[ [Tips] Enchancement on Document Template Select Box]]> https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109409
Hope it might be usefull to some of you, and finally get added to the core distribution file. laugh

Somebody already built a better plugin to do this.
http://modxcms.com/forums/index.php/topic,1092.0.html




Look at line 543 on "manager/actions/dynamic/mutate_content.dynamic.action.php". Replace the whole code inside <?PHP ?> tag with this code.
			<?php
			if(isset($_REQUEST['pid'])) $parentTemplate = $modx->getPageInfo($_REQUEST['pid'], 1, 'template');
			while ($row = mysql_fetch_assoc($rs)) {
				if(isset($_REQUEST['newtemplate'])){
					$selectedtext = $row['id']==$_REQUEST['newtemplate'] ? "selected='selected'" : "" ;
				}
				else if(isset($content['template'])) {
					$selectedtext = $row['id']==$content['template'] ? "selected='selected'" : "" ;
				}
				else if(isset($parentTemplate) && $parentTemplate) {
					$selectedtext = $row['id']==$parentTemplate['template'] ? "selected='selected'" : "" ;
				}
				else {
					$selectedtext = $row['id']==$default_template ? "selected='selected'" : "" ;	
				}
			?>


Hope it might be usefull to some of you.

Note: I changed the code, before I use the wrong API getParent instead of getPageInfo

Regards,]]>
wendy Jan 17, 2006, 10:43 AM https://forums.modx.com/thread/19697/tips-enchancement-on-document-template-select-box#dis-post-109409