Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] set default_template valeu when psuh create transration button in manager #63

Closed
saburo9 opened this issue Sep 26, 2012 · 1 comment
Labels

Comments

@saburo9
Copy link

saburo9 commented Sep 26, 2012

hi. thank you for grate plugin.

this is feature request.

I have 4 mulit langage site. I made a mistake in the setup of template id ,because Set current template id for new page when psuh "create transration" button in manager

I hope set default_template value in context_setting when psuh "create transration" button in manager.

for exsample in (bable.class.php in duplicateResource() )

$newResource->set('publishedby',0);
$newResource->set('context_key', $contextKey);
// addcode start
$context_setting = $this->modx->getObject('modContextSetting', array(
'context_key' => $contextKey,
'key' => 'default_template',
));
$default_template= $context_setting->get('value');

if(!empty($default_template)){
    $newResource->set('template', $default_template);
}
// add code  end 
thanks.
@goldsky
Copy link
Collaborator

goldsky commented Nov 26, 2014

It doesn't make any sense if duplicating the resource gets different template.
Thus it's called duplicate.
Babel takes the template from the original resource's template.

$newResource->fromArray($resource->toArray('', true), '', false, true);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants