Jump to content

thistimj

Members
  • Posts

    71
  • Joined

  • Last visited

Everything posted by thistimj

  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.
  16. The regular image field works as expected, which is why I am a bit confused as to why Image Extra wouldn't work. What log files are you referring to? Here is a screenshot of what I'm getting. The field above is a normal image field; you can see part of the image.
  17. This module looks great, however, I am having a bit of trouble getting it to display the image I upload. I set everything up, upload an image, and the progress bar stops at 100% without going further and showing the image as usual. When I refresh the page in the admin, there is no image associated with the image field. I checked the assets folder, and the image is getting uploaded to the proper folder, but it's not showing up on the page. I am using PW version 5.2.3.
  18. I'm not sure where to put this, but because I got the basic code from Ryan's post in this thread, I'll put it here. I was working on a portfolio site where the Work page spits out a list of thumbnail links. I scoured the forums looking for a simple prev/next link setup to move from page to page of the work thumbnails. I'm still learning PHP, so I can't solve these problems from scratch. Thankfully, I came across this thread and the basic solution to my problem. After tweaking Ryan's code and adding a couple of things, I came up with this: // What we are trying to grab $entries = $pages->get("/work/")->find("template=work-entry, sort=sort, limit=2"); // values we need to make this work $start = $entries->getStart(); $end = $entries + count($entries); $total = $entries->getTotal(); $num = $input->pageNum; $lastNum = ceil($total / $entries->getLimit()); // prev link if($num > 2) { $prevLink = "./page" . ($num - 1); $prevLinkClass = "class='NavPages-item NavPages-item--prev'"; $navPagesPrev = "<li {$prevLinkClass}><a href='{$prevLink}'>« Newer</a></li>"; } else if($num == 2) { $prevLink = "./"; $prevLinkClass = "class='NavPages-item NavPages-item--prev'"; $navPagesPrev = "<li {$prevLinkClass}><a href='{$prevLink}'>« Newer</a></li>"; } else { $navPagesPrev = ""; } // next link if($num < $lastNum) { $nextLink = "./page" . ($num + 1); $nextLinkClass = "class='NavPages-item NavPages-item--next'"; $navPagesNext = "<li {$nextLinkClass}><a href='{$nextLink}'>Older »</a></li>"; } elseif($num == $lastNum) { $navPagesNext = ""; } Then you can output the links with <ul class="Nav NavPages"> <?php echo $navPagesPrev; echo $navPagesNext; ?> </ul> When you're on the first page, the prev link won't show up, and when you reach the last page, the next link will disappear. I used a small limit to make sure it worked for over 2 pages of links. I hope somebody will find this useful.
  19. Whenever I run into something weird like this (which is often), I'll add in some sort of test to see if I am missing something. Try pasting this code somewhere on your page where you will notice the word "yay" or "nope" appear: <?php if($pages->get("title=news")->child->id) { echo "yay"; } else { echo "nope"; } ?> If your news page is called something else, change "title=news" to whatever your page is called. This will let us know that you have at least one child page under that parent page. If it says "yay", I have no idea what is going on, but if it says "nope", maybe your child pages are hidden or unpublished.
  20. I was more asking if the loop was actually generating the <h4></h4> markup without any content between the tags. That way, we would know that part of what you're trying to accomplish is working.
  21. Yeah, the php } ?> closes out the foreach loop. Do you see any empty h4s or ps if you view source?
  22. If I am understanding correctly, you have news entries using the template "widgetNews". I assume the parent News page uses a different template. If this is the case, you could do this: $newsItems = $pages->find("template=widgetNews"); foreach($newsItems as $newsItem) { ?> <h4><?php echo $newsItem->newsTitle; ?></h4> <h4><?php echo $newsItem->newsDate; ?></h4> <p><?php echo $newsItem->newsSummary; ?></p> <?php } ?> I think that should work.
  23. thistimj

    Muesli Café

    Really like the site. The pictures are fantastic! The video is great as well. Good luck with your endeavors!
  24. @MadeMyDay, unchecking the Global box on the title field worked. @Soma's advice also worked. I unchecked "Required" for the template's title and changed the "Visibility" to hidden. Worked like a charm. Thank you!
  25. I have a couple more issues. I'll add, let's say, a block of text using the PageTableExtended field. When I hit the publish button in the modal window, it does not publish. I check the settings panel in the modal box, and it consistently has the box checked for "Unpublished." When I uncheck that box and go on about my business, everything works out wonderfully, but I cannot get it to publish the "regular" way. Am I doing something incorrectly? Also, I have noticed that when I make changes to one of the PageTableExtended blocks on a page and save the page it is a part of, I get a warning about a "Missing required value" under the Title label. I assume it means I'm missing a title somewhere, but the page has a title and the PageTableExtended blocks have automatic titles. Anyone have any guesses? Thanks!
×
×
  • Create New...