Jump to content

Change page parent despite template settings?


suntrop
 Share

Recommended Posts

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

Link to comment
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;

 

Link to comment
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

 

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

On PW 3.0.141, can anyone think of why as a logged-in Superuser with no visible Page Edit/Move restrictions on current page (let alone Templates, Pages, or any Parent Pages), I am getting a "You don't have permission to move pages using this parent" error in the Pages tree? Thanks.

image.png.b8f2fe458910b9bf0a793abafbbe2b01.png 

Link to comment
Share on other sites

On 10/7/2019 at 1:45 AM, WinnieB said:

On PW 3.0.141, can anyone think of why as a logged-in Superuser with no visible Page Edit/Move restrictions on current page (let alone Templates, Pages, or any Parent Pages), I am getting a "You don't have permission to move pages using this parent" error in the Pages tree? Thanks.

I've had some strange issues recently with pages that had a parent template restriction in the family settings and moving/creating them parent pages that in turn had a child template family restriction. Unfortunately, I didn't have time to investigate this further and just removed one of the restrictions to get things working again.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...