Jump to content


  • Posts

  • Joined

  • Last visited

timothy.m.wilson's Achievements


Newbie (2/6)



  1. Thanks for the feedback guys. I got this one figured out. Just wrote a small script to reset the parent of each blog post and then rendered the blog home page from within the home page template. $posts = $pages->find("template=blog-post"); foreach($posts as $post) { $post->of(false); $post->parent = 1; $post->save(); } and in home.php... echo $pages->get('/blog/')->render Everything is working as I hoped it would.
  2. Hi rick, Thanks for replying. Based on your feedback, I would be just fine with this structure: Blog ----Blog Post 1 ----Blog Post 2 Simply removing "Home" would be acceptable. The Blog page is the home page anyways. So, having that at the root level would be good. The end result is to remove the "/blog/" from the url and have the url be "example.com/path-to-blog-post" instead of example.com/blog/path-to-blog-post"
  3. Good afternoon. I am trying to figure out how to move a child parent and it's descendants to the root level. For example, I have: Home ----Blog --------Blog Post 1 --------Blog post 2 What I would like to have is Home Blog ----Blog Post 1 ----Blog Post 2 Not as simple as drag and dropped like I had hoped. Hoping there is some kind of module or api call I can make to simplify this. Thanks in advance.
  4. Thanks for the reply. Definitely pointed me in a much better direction. Got it figured out now. Cheers!
  5. Good afternoon, I am attempting to loop through approximately 600 XML nodes. Each of those nodes has 2 child nodes (example below). One is an id for an existing page and the other contains values for a page reference field. I have put together a loop (below as well) to attempt to save each page with the label values. This all works....once. After getting the first XML node "label" saved to the correct page, nothing else is saved. I'm sure there is probably something that I have overlooked. But, I am also very new to this CMS. I'm hoping there is a veteran user who may be able to point me in the right direction. <row> <id>1041</id> <labels>lifestyle|savings</labels> </row> foreach ($xml->row as $items) { //get page id to update and set output formatting to false $blog_page = $pages->get('id='.$items->id); $blog_page->of(false); //create array from pipe separated label values $labelsArray = explode('|', $items->labels); //loop through array to get page ids by page name $labelIDS = array(); foreach ($labelsArray as $labelValue) { $labelPage = $pages->get('name='.$labelValue); array_push($labelIDS, $labelPage->id); } //add labels to label field in post $blog_page->labels = $labelIDS; //save page $blog_page->save(); }
  • Create New...