Jump to content

how to quickly rename large quantity of pages


bwakad
 Share

Recommended Posts

As I am experimenting from the skyscraper site profile I managed to change a few things - menu, fields, selector, and other things.

Now I ask if there is some kinda module like the CSV import module, but just to rename? or is the simplest way to remove and just import new ones? Since the pages are with content, it would be nice to keep it for now.

Link to comment
Share on other sites

http://modules.processwire.com/modules/process-batcher/

https://processwire.com/talk/topic/5835-lister/

EDIT: was on mobile before. Batcher won't actually let you rename existing pages, but you can batch create pages easily.

It will be possible with the upcoming Lister module though, or you could write some code to do it yourself - it's not that hard, but you do need to consider how you would batch rename - can you give an example of the format you might want, because you have to consider not just the title of the page, but also the name with determines the url of the page, unless you are talking about hidden pages (perhaps those that belong to a page field). I can't imagine you want page-1, page-2 etc. Do you have a schema in mind?

  • Like 1
Link to comment
Share on other sites

Okay, since I use Skyscraper as a base to start. I need to rename the present Architect-name to Company-name.

So Architect: A Eugine Kohn becomes Company: McDonald.

And so on...

Right now, I am only concerned about the title, but opening the page and under settings-tab the part of the url need to be set to.

I can of course do it one-by-one, but I thought there might be an easier way.

Link to comment
Share on other sites

If I understand correctly, I don't really see how that make sense. Currently the Skyscrapers site has a parent page called Architects with a lot of child pages with just a title field which lists the names of all the architects. I am not sure how it would be easier to try to rename all of these to the names of the companies you need. It would be more logical and easier to just create the company pages from scratch. You could use Page Field Select Creator like we talked about in another post, or you could use the batcher module, or the CSV importer, or write a simple script like the following:

$pagesToCreate = array('McDonalds','Nike','Apple','Google');
foreach ($pagesToCreate as $ptc){       
       $np = new Page();
       $np->parent = $pages->get("/companies/");
       $np->template = $this->templates->company;
       $np->title = $ptc;
       $np->of(false);
       $np->save();
}
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...