Jump to content

thistimj

Members
  • Content Count

    71
  • Joined

  • Last visited

Community Reputation

58 Excellent

About thistimj

  • Rank
    Full Member

Profile Information

  • Gender
    Male

Recent Profile Visitors

3,492 profile views
  1. Thanks again, @Robin S. I appreciate it!
  2. @Robin S thanks for that! That got the basic functions of the module to work for me. I may be missing something, but is part of the function of this module to give the child pages titles as well as names? The names are working, but the page titles are not being constructed according to the naming convention I'm assigning via the module.
  3. I accidentally stumbled onto my own solution. It doesn't seem intuitive to me (that doesn't really mean that it doesn't make sense), but to switch templates, I had to assign "Create Pages" access to the role on the template. Once I did that, I was able to log in as the contributor and change templates. Hope this helps someone else in the future.
  4. kixe, the page in question is a child of the home page. I don't have any restrictions on those templates.
  5. Hello everyone! It's been a while since I've posted on here, but I've got an issue that I haven't been able to solve by searching through old posts. I'm trying to allow a user to change templates on only two pages of their site. I've enabled page-edit and checked the box for page-template. When I log in as the user role, the template dropdown works, but it only shows the current template and no others. I'm using version 3.0.39 if that makes any difference. I'm stumped. Thanks in advance for your help and suggestions! They are much appreciated.
  6. I realize that. Even used the Google to run a search on the forums. Seemed like the previous threads were a bit old. I should've just bumped Ben's thread here.
  7. I'm currently with HostGator, and I'm wondering if anybody has had good experiences with other shared hosting companies. I was looking at Inmotion and Stablehost. Thanks!
  8. Cool. Welcome to ProcessWire. I'm sure you're going to like it!
  9. I'm not sure you need the $k => $p where you have it. It should work with this: <?php foreach($page->children as $child): ?> <div class="mask"> <img src="<?php echo $child->images->first()->url; ?>" /> <h2><?php echo $child->headline; ?></h2> <?php echo $child->body; ?> <a href="<?php echo $child->url; ?>" class="info"><?php echo $child->title; ?></a> </div> <?php endforeach; ?> If I'm understanding you correctly, this should get you most of the way to where you want to go. I'm not a php expert and I haven't tested this, but I think that's right. Let us know if that works.
  10. Do you have your image field set for one image in each of your child pages, or are there multiple images in each child?
  11. I figured out my issue. I had set my work-entry template to only allow pages with entry-image as children. I had to add entry-text as an allowed child template. D'oh! Maybe this will help someone in the future.
  12. I am having a problem with Page Tables. I am using 2.5.14 dev on my local WAMP install, but I remember having similar issues with the latest master version. I set up my templates: entry-image and entry-text; these are what I want to control with my Page Table field called entry_sections. I add entry_sections to my work-entry template and I see the "Add entry-image" and "Add entry-text" buttons at the bottom of the Page Table field. When I click add entry-image, the modal window says "entry-image" as it should. But, when I click the button to add entry-text, the modal window says "entry-image". As a test, I went to the entry_sections field and removed the entry-image template. When I go back to the page, it still only wants to add "entry-image" even though the only option is to add entry-text. Ideas anyone?? Thanks.
  13. @adrian, That did it! I was so close to the solution!!!! I had the deleteAll in my code earlier today, just in the wrong place. Which doesn't really count, but still. I'm learning a lot from all of you php experts, and I am really grateful that you guys know so much. Thanks for the module. It's going to be a big time-saver.
  14. Thanks for this module, adrian. It's something I've been hoping someone would make due to my lack of php ability! I've been trying to figure out how to get the images from the parent page to auto-delete on save. I've only managed to accomplish this if I save only one image at a time. If I add more than one image, I get this error: Session: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '______________' for key 'name_parent_id' Here is the code I am using. I changed a couple of things from adrian's code, and I've commented those lines below: public function createImagePages($event){ $page = $event->arguments[0]; if($page->template == 'work-entry'){ // I changed the template name to match mine foreach($page->images as $image){ if($this->pages->get("parent={$page->name}, name={$image->basename}")->id) continue; $np = new Page(); $np->of(false); $np->template = $this->templates->get("entry-image"); // I changed the template name here too $np->title = $image->description ? $image->description : $image->basename; $np->name = $np->title; // I wanted the page name to match the title $np->parent = $page; $np->save(); $np->image->add($image->filename); $np->image->last()->description = $image->description; $np->save(); // These lines work to remove the image from the parent page $page->images->remove($image); $page->save(); } } } Anyone have any idea of where I'm messing this up? Thanks!
  15. It ended being some weirdness caused by the Language support module. I had to uninstall that module, reinstall it, and your module started working. Very weird. Thank you for taking the time to help out. I'm looking forward to using your module.
×
×
  • Create New...