suntrop

Change page parent despite template settings?

7 posts in this topic

I have configured some template to be not movable, so the editors can't move them around. But actually I need to move them with the API. Is there some way to avoid the error 

Pages using template 'order' are not moveable

Share this post


Link to post
Share on other sites

Untested, but it might be possible to change the template object's noMove property before and after moving the page:

<?php

$nomove = $page->template->noMove;
$page->template->noMove = false;

$page->of(false);
$page->parent = $pages->get('/my/new/parent/');
$page->save();
$page->of(true);

$page->template->noMove = $nomove;

 

Share this post


Link to post
Share on other sites
9 hours ago, suntrop said:

I have configured some template to be not movable, so the editors can't move them around. But actually I need to move them with the API.

You can revoke the "page-move" permission for a template per role:

2017-05-03_112911.png.aab1db9c2cdca58046d7345f0aa694bc.png

 

1 person likes this

Share this post


Link to post
Share on other sites

Thanks both of you!

Where do I find that option? 

I am using 3.0.42 and can't find that option.

Share this post


Link to post
Share on other sites
3 hours ago, suntrop said:

Where do I find that option?

Setup > Templates > [template name] > Access tab

Share this post


Link to post
Share on other sites
15 minutes ago, suntrop said:

I don't have that. !?

The role must have Edit permission for the template: page-sort and page-move are sub-permissions of the page-edit permission.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.