Jump to content

slkwrm

PW-Moderators
  • Posts

    321
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by slkwrm

  1. Tried it out too, works great! Experimenting with selectors I found something that makes me now ask the following question: $results1 = $pages->find("$selector1"); $results2 = $pages->find("$selector2"); $allResults = $results1->import($results2)->sort("-modified")->find("limit=5"); This code works. But if I use the following code, it ignores the second parameter (limit): $allResults = $results1->import($results2)->find("sort=-modified, limit=5"); And if I switch them to find("limit=5, sort=-modified") then sort parameter is ignored. Is it ok?
  2. You can safely leave your request separate, but merge them afterwards: $total_results->import($my_textual_results);
  3. Sounds great! I would be really happy to attend it.
  4. You think could use something like this: $categories = $pages->find("template=one-category"); foreach ($categories as $cat) echo '<p>' . $cat->title . ' (' . $pages->count("template=one-article, article_categories=$cat") . ')</p>'; or, if you use it in your category template: echo '<p>Category ' . $page->title . ' has ' . $pages->count("template=one-article, article_categories=$page") . ' articles!</p>'; Edit: Processwire is optimized for such requests, so there shouldn't be any serious penalties for using several queries in a loop.
  5. Also heard only good things about PhpStorm. Maybe you guys will find these links useful: Early Access Program - can be used to run PhpStorm for free (you have to download a new development version from this page after 30-days trial expiry.) Open Source License - Ryan, it may be interesting for you and other open source project leads. I think ProcessWire project meets their requirements so you can apply to use it for free
  6. You're not alone, Nico.
  7. Very nice module, Soma. What do you think about adding a shortcut to view an overlay with shortcuts cheat sheet? Or even a link to click on somewhere in admin interface, maybe next to profile/logout? Also maybe some snippets from here to navigate between next/previous items will come in handy to enhance your great module.
  8. @anibas94 Ryan is totally right. Sorry, it seems I was in hurry and didn't read the first part of your post
  9. Yeah, Soma's right! You can do it this way: foreach ($page->myrepeater as $item) { if ($item->visible) { echo "<p>$item->title</p>"; //or do something else... } } or this: foreach ($page->myrepeater->find('visible=1') as $item) { echo "<p>$item->title</p>"; //or do something else... }
  10. I think it's because you use $pages->find() as a second argument. It returns PageArray, not a page object. Try to use $pages->get() or $pages->find("parent=1008,name=$nutzer")->first() instead.
  11. Looks interesting! Can't wait to check it
  12. Only a few hours to convert! Well done!
  13. +1 for LinkMonitor. Great additions!
  14. This should be included in default installation
  15. Hi, Michal. I'm not sure you need to delete "core" permissions for they provide Processwire's essential functionality and, btw, you can't delete them from back-end. For example, you add a permission, grant it to one of your roles and then write code to check against this permission in your template: if ($user->hasPermission("touch-this")) { echo "The world is yours!"; } else { echo "Can't touch this!"; } So $user->hasPermission() will return true if a user has a role to which this permission is granted, otherwise it will return false. The only exception are users with superuser role as it has all permissions granted by default. For this users $user->hasPermission() will always return true even if superuser role doesn't have a permission granted (checked in back-end). Deleting a permission is like taking it away from a role and respectively from all users with this role. So after you deleted a permission, $user->hasPermission() will return false when checking against this deleted permission for all users except ones with a superuser role. This is based on my limited experience, I'm sure there's more to say on this topic. Edit: corrected "front-end" to "back-end".
  16. I guess the first step here is to create a pages in a tree for each user (when a user is created/registered) with the same name as a user id so it can be non-ambiguously associated with this user. Then add a verification that user can access pages only under this personal page, i.e. view/edit/add only page's children. Also you want to narrow allowed templates range for this children-pages. The second step is to give access to some interface to edit personal pages. I'm honestly not sure which option you need here. You can use PW's back-end for it, but then your users will see the whole site tree unless you write a module that modifies the default output. As an alternative, you can build a custom front-end interface for this task, but it will require some work. I'm sure there's also a security concern here as you intend to let your users upload files and use WYSIWYG-editor. Maybe someone more knowledgable can elaborate on this
  17. I think this is a really good idea as it will help to adopt PW among PHP developers who use IDEs in their work (such as NetBeans, PHPStorm, Eclipse etc.). As a side effect it can potentially make more people here use IDE. Autocompletion is addictive
  18. What should be the general structure/format of an article? I have a nice collection of advices from you, guys, which I gathered on this forums. And I think at least some of them could be converted into small wiki articles. But I'm not sure whether it is a good thing to duplicate information from the forums anywhere else. Also not sure my language skills are bearable enough to contribute to wiki.
  19. Thank you for this update, Soma! Having tried both modes, with and without transition, I can tell I definitely prefer the latter
  20. Yeah, maybe I'm too hardcore here. I turned off most of Windows 7 eye candy at first, but some time later I turned on Aero Peek and transparency back . XP was ugly but it was fast! Now every time I see it I wonder how could I use it for so many years. Soma, it would be great to have this animation switch option. I thought there will be a long discussion before this change could be made. And with this on/off option everybody's happy! Thank you! Edit: @Apeisa. Sorry, didn't see your reply. Yes, using a browser script is another good way to handle it, especially if this change is hard to implement. Thank you for this idea.
  21. Yep. It was cache. I thought I had it disabled. Great work, Soma! This became an indispensable tool for me! Thank you! +1 to ditch animation in favour of speed and simplicity Or maybe make it quiker and more subtle. What do you think, guys?
  22. slkwrm

    DRY URLs

    If it matters, I guess it won't be too hard to implementa module which will substitute internal links to external ones. But then you have to remember to clear your cache (if you use it) every time the link page updates.
  23. Don't know why, but the new version looks really wierd and behaves glitchy in Firefox 13.0.1 for me. Works great in Chrome though. Can anybody else see this things or I see things?
  24. @Soma Thank you for explanation, I'll check your example. @Ryan Wow! This is something I haven't seen yet! Gone to dig some code
  25. I guess this does the same thing. for multiple pages field: $mySiblings = $page->yourpageselectfield->first()->siblings(); for single page field: $mySiblings = $page->yourpageselectfield->siblings();
×
×
  • Create New...