Jump to content

Some beginner questions


peterfoeng
 Share

Recommended Posts

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).

  1. When we delete a page, does it delete the corresponding folder asset?
  2. 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

Hi!

On a bit of a rush here, just some short answers:

  1. Yes.
  2. 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.
  3. 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.)
  4. No, created date tells when page was created, i.e. added :)
  • Like 4
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...