Jump to content

caribou

Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by caribou

  1. More use cases for pages-as-image-picker: News sites - a generic article with no photos gets a generic accompanying image, e.g. an EU flag for EU stories, a police car for police stories, etc. There can easily be hundreds of such stories, and dozens of such photos. It's not very elegant to make users upload the same photo 200 times. Donated images - It's common for nonprofits to be donated use of photos for x years, but they must ensure the photos are properly described and credited every time they're used, and are replaced when the contract is up. This is pretty much impossible without central image management, especially with multiple users.
  2. Yesssss, I am so excited about this. This was the only real stumbling block to using PW for a bunch of projects.
  3. @kongondo Fantastic! I'd be happy to help you beta test.
  4. Thanks for this! I'll take a look and see if I can make it work.
  5. Very cool plugin! I suppose it could also be a button launching a modal window (as in other CMSs), so there would be more real estate to work with images, including search and pagination.
  6. Like others here, I build sites that require reuse of images. In my case, the images must always be accompanied by correct credits and descriptions, and must be replaced sitewide when our contract with the photographer ends. So centralized image storage is a must, and one page per image works fine. The challenge is selecting image pages from other pages in an easy, visual way. Soma's images module is a great move in that direction, but for my needs, users should work only with thumbs, never with HTML. The default pages field seems like it's allllmost there. I'd just like one of the field label choices to be the image field, and to choose a page by thumbnail. Ideally, the thumb will be shown on the page after selection, as it is with the images field. Even more ideally, the page picker will include search. Even even more ideally, I'd have the time and php chops to build this module myself.
  7. That worked! I just added this to my form after retroactively updating the other ones: <?php foreach ($languages as $language){ echo "<input type='hidden' name='status{$language}' value='1'>"; //Make active in all languages } ?> Thanks very much for your help!
  8. Good catch - they were being added through the API, and they weren't being set as active. I see this thread addresses the issue - I'll give it a try. https://processwire.com/talk/topic/4383-how-to-set-language-active-via-api/
  9. More sleuthing! I'm a regular Sherlock over here. Only one template is exhibiting this problem. The only difference between this and other templates is that it doesn't have a template file associated with it. I created a file for it, but it didn't make a difference. I'm stumped. To sum up, If I look for sort=-created, limit=5, I get the same results at foo.com and foo.com/es. If sort=-created, limit=5, template=x, same results at both But if sort=-created, limit=5, template=y, I get the expected results at foo.com, but at foo.com/es, It only gets pages added before I installed the multilanguage modules. I haven't made any other changes to template y. Any ideas on troubleshooting template y?
  10. Further research - this only happens if I specify the template in the query. So this shows all recent pages of any type in any language: $placemarks = $pages->find("sort=-created, limit=5"); foreach($placemarks as $placemark){ $since = date("Y-m-d",$placemark->created); echo "{$since}<br/>"; } But this only shows pages created before I installed the multilanguage module, if I access any language other than the default (foo.com/es instead of foo.com, for example). $placemarks = $pages->find("sort=-created, limit=5, template=placemark "); foreach($placemarks as $placemark){ $since = date("Y-m-d",$placemark->created); echo "{$since}<br/>"; } Which indicates that by installing the module, something changed with my templates - but what?
  11. Here's an odd problem. Suggestions welcome! In one of my templates, I list the 5 most recent items. After installing multi-language, the default (English) contiues to work as expected. In the other language, the recents stopped updating the day I installed the module. See attached. Edit: On further exploration, anywhere I list pages in any order, pages created after I installed the module don't show up in any language but default. Compare the recent updates menu here: http://wwfgap.org/tracker/jaguar/puerto-iguazu/ and here: http://wwfgap.org/tracker/es/jaguar/puerto-iguazu/ Here's the code: <?php $recents = array(); foreach($pages->find("template=placemark, limit=5, sort=-created") as $placemark){ $since = $placemark->created; $since = date("Y-m-d",$since); $recents[] = "<li><a href='{$placemark->parent->url}'><img src='{$placemark->parent->icon->url}' alt='icon'>{$placemark->parent->parent->parent->title}: {$placemark->parent->title}</a><br><em>{$since}</em></li>"; } $recents = implode($recents); echo "{$recents}"; ?>
  12. Thanks for the Leaflet recommendation! Google Maps is an enormous pain sometimes, so I'm happy to try something new. Maybe for version 3.0!
  13. @Pete - Thanks very much! I forgot about retina until I'd created all the markers (argh), so that's the next thing on the to-do list. @apeisa - Thanks! It's a lot of fun to work on, and PW's flexibility is a great help. I've done similar stuff with ExpressionEngine in the past, but this was far less hassle.
  14. WWF sponsors a number of projects to track wildlife with satellite tags - this Processwire/Google Maps tool lets the public follow along in nearly real time. There are 6 different species and over 40 individual animals. http://wwfgap.org/tracker/ This is the second iteration using Processwire - it was a delight to work with. Feedback welcome!
  15. Edit: In other news, I've discovered that a foolproof way to find obvious code errors is to post a problem here. Then I immediately see what I did wrong, but can't delete the post... For the record, double quotes in the find, and I used just template instead of $page->template further up the page. --- Hello again, helpful forum members. I am trying to create a complex query, but not having any luck. In this example, I'm looking for pages with a specific template (could have any parent) *and* pages with a specific parent (could have any template). I understand the or operator doesn't work within find yet, so is there a different way to stack and combine queries? I've determined that this way doesn't work: ... $template = $pages->find('template=species'); $children = $pages->find('has_parent=$page'); $windows = $pages->find('id=$template|$children'); ... foreach ($windows as $window) {... Thanks!
  16. Thanks for the quick reply! Yes, the ugly solution works. This is on the blog template, so yep, the children are the blog posts.
  17. Hello! I have a number of blogs, and blog post uses a page input field to select an author. For each blog, I want to create a list of authors who have contributed to that blog. Here's the structure: Authors - Don - Peggy - Pete Blogs - Blog 1 - Blog 2 I can do this on the blog template: foreach ($page->children->find('author!=""') as $child) { echo $child->author->title; } ...but that lists duplicates (i.e. Don Don Don Peggy). I'd like to echo each author only once. Thanks!
  18. Edit: Never mind. Simple typo on the equal signs. Carry on! Hello! I am trying to use $child->first() inside a loop, but I get the error "Error:Call to a member function first() on a non-object" Any pointer on what I'm doing wrong? Thanks! foreach($page->children->find("sort=-markerdate") as $child) { $current = $child->first(); if($child = $current){ $icon = $child->parent->icon->url; }else{ if ($child->icon != ""){ $icon = $child->icon->url; }else{ $icon = "image.png"; } } }
  19. Thanks very much, this worked! In this case, rootParent worked too.
  20. Hello! I'd like to sort search results by title within their parents' parent. This sorts by title alone: foreach($pages->find("template=individual")->sort(title) as $individual) { echo "<option value='".$individual->name."'>[".$individual->parent->parent->title."] ".$individual->title."</option>\n"; } And gives me something like <option value="Bob">[Grandpa Joe] Bob</option> I'd like to list all grandchildren of Grandpa Joe in order, then all grandchildren of Grandpa Lou, etc, grouped by grandparent name. What's the best way to do that?
  21. This is probably an easy one! I'm trying to list pages with a given tag. But I need that tag to be a variable. It works without the variable: foreach ($page->find('template=placemarks, tag=1009') as $child){ ...but this doesn't work: $tag="1009"; foreach ($page->find('template=placemarks, tag=$tag') as $child){ What am I doing wrong?
  22. Hey all, I would like to give a user role permission to create pages, but only with certain templates in certain branches. Using Page Edit per User, let's say I give a role permission to edit pages in /foo/. If I don't give them permission to create pages under Template > access, they can edit, but not create pages in /foo/. If I do give them create pages under Template > access, they can create pages in /foo/, but also in /bar/ and all the other branches that use that template. So what I'd like to do is extend the branch limitation of the module to creation, not just editing. Is the best way to accomplish that by editing the Page Edit module? Thanks!
  23. I agree with onjegolders - we manage 100s of pages as map placemarks, and I can't ask users to delete hundreds of pages by hand if an import goes south. I also want to be as hands-off as possible, and I'd much rather give them the ability to do this. Edit: playing around with Batcher, it might do the trick.
  24. I want to list the names of pages with the template "individual", so I did this... <?php foreach($pages->find("template=individual") as $page) echo $page->name; ?> It echos an array of page names, as expected, but then it throws one page body (and just one) at the very end of the file. Where is that page body coming from? I'm stumped. UPDATE Never mind, solved my own problem. Renamed $page to something else, and it worked as expected.
×
×
  • Create New...