peterfoeng Posted November 27, 2013 Share Posted November 27, 2013 Hi guys, I have some beginner questions that I can't seem to find an answer (maybe I am looking for the wrong search keyword). When we delete a page, does it delete the corresponding folder asset? I have a selector in a template like the following: $pages->get($page->menu_category->id)->find("template=Menu-Item-PDF, include=all")->menu_item_pdf_exclude; which should return PageArray (asm multiselect field). How do you I find a page within this returned array? When I try to print the result of the selector above it gives me a string separated by a pipe character e.g. 1205|1206, am I expecting a PageArray here? 3. Is there a way to clone/move the whole tree? For example I have a page called "Product" and has 100 child pages, can I make a clone of of the tree structure? 4. Is created date = published date? What happens if I published and unpublished a page, will the date get updated? As always I would like to thank you in advanced for the answers to my questions Link to comment Share on other sites More sharing options...
teppo Posted November 27, 2013 Share Posted November 27, 2013 Hi! On a bit of a rush here, just some short answers: Yes. PageArray, when treated as a string, should look like that. See PageArray->toString() for more details. You can access specific items with $pagearray->eq(0), $pagearray->eq(1), $pagearray->first(), $pagearray->last() etc. or iterate it with foreach. Through API or via admin UI? Both should be doable, admin UI has "copy" link and http://cheatsheet.processwire.com/ provides details for API side (tip: look for "clone" method from Pages or PageArrays.) No, created date tells when page was created, i.e. added 4 Link to comment Share on other sites More sharing options...
adrian Posted November 27, 2013 Share Posted November 27, 2013 RE: 3 - You need to install the core module - "Page Clone". Simply go to Admin > Modules > Process > Page Clone > install 2 Link to comment Share on other sites More sharing options...
peterfoeng Posted November 28, 2013 Author Share Posted November 28, 2013 Thanks guys for the help Cheers 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