Jump to content
suntrop

Change page parent despite template settings?

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

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

 

  • Like 1

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

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 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...