bwakad Posted March 23, 2014 Share Posted March 23, 2014 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 More sharing options...
adrian Posted March 23, 2014 Share Posted March 23, 2014 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? 1 Link to comment Share on other sites More sharing options...
bwakad Posted March 24, 2014 Author Share Posted March 24, 2014 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 More sharing options...
adrian Posted March 24, 2014 Share Posted March 24, 2014 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 More sharing options...
bwakad Posted March 24, 2014 Author Share Posted March 24, 2014 I see your point. Ok, i will try that module first. Thanks for thinking with me. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now