Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. In the admin we have an option to set a sorting for children using one field only. I have a problem with children getting sorted randomly when using a date field that is the same for multiple children. Usually we would sort by date and by ID or title, but we are only allowed to specify one field at a time. The problem with this is that once you edit one of those children, the sorting is randomly changed (actually everytime you edit a children) That's not really nice and very confusing. I had to use a dirty hook to change the children sorting one parent manually. $this->addHookBefore("ProcessPageList::find", $this, "sortingChildren"); public function sortingChildren(HookEvent $event){ $sel = $event->arguments("selectorString"); $page = $event->arguments("page"); if($page->template == "news-category"){ $event->setArgument("selectorString", $sel . ",sort=-datetime, sort=-id"); } } Maybe there's already a way I don't know or a module? But then I think this should be in core of course and not a module. Thanks.
  2. I'm not sure I understand, but this module doesn't duplicate anything, so I'd guess it must be you.
  3. @mike 1. It's not possible to add a extra link as overview like you mention. This module parses your tree and needs physical pages to work with. If you really need this you have to build a page for it or use javascript to add the overview link to the list (I'm doing this in one project). 2. The parent of the active entry will get the class as defined in option "parent_class" so default is <li class="parent"> It's all documented here http://modules.processwire.com/modules/markup-simple-navigation/ This module adds classes to li's and not anchors for a good reason as that is much more flexible. There's no option to change that. So if you need such special cases you're up to use javascript. Or us php str_replace() to replace something on the returned markup. Let's see if you want to change class="parent" for parent li's you'd maybe do this $markup = $nav->render($options); $markup = str_replace("<li class='parent'", "<li data-current", $markup); Also there's some method to hook into and change things on items or lists, there's plenty examples in this thread and in the doc.
  4. @pwired, there's no way to track that via a client side webdev tool like firebug or any other, it's just not possible (seems logical). You need to search on filesystem either directly on server via grep command or download all files locally and use some search provided by a IDE or Code editor like sublime text.
  5. RT @processwire: New blog post: Wrapping up the comments upgrades, ProcessWire 2.5.11: https://t.co/KUAd0cXcJD – Added up/down voting & Com…

  6. 2.3 is very old and surely there's bugs, but not sure it's fixed completely and it really has to do with clone tool. There was a attempt to fix issue with it, but I got a coworker running into it where this fix was in place already so it's a mistery.
  7. What PW version? That's why I'm not using clone tool. But see others using it all the time. This bug is not something you'll recognize unless you use has_parent, and I think there's lots of PW sites where this happens and nobody recognized it yet. It's that the parents table is broken for those. It's annoying cause once you stumble over it you have no idea whats happening, or you don't even will ever notice that some pages may not get returned.
  8. It a bug known since a long time, but Ryan can't reproduce it. I got caught by it years ago, and recently it happened to 3 other people. Can you tell what you did to those pages? Move around, clone? https://github.com/ryancramerdesign/ProcessWire/issues/404
  9. You have moved those pages around from amother parent? Move those out of the parent and then back in. Works?
  10. The field is not an object but a string. Turn off output formatting.
  11. I think problem is that with fulltext ~ and * mysql doesn't index words with hyphens, I think it splits it and since it's left with "1" it doesn't index 1 or words with less than 4 chars. So if you use ~=sport it will find your sport-1 cause it's only indexing "sport". http://stackoverflow.com/questions/5192499/how-to-allow-fulltext-searching-with-hyphens-in-the-search-query http://bugs.mysql.com/bug.php?id=2095 Using % will work but also search phrases so sport-1 would also find sport-12 For now maybe don't use hyphens. After all Tags should be words not "word-word" see?
  12. I'm not seeing any problem with %=sport-1 as horst suggested. It finds all iamge that has the tag "sport-1"
  13. I'm not sure really, but maybe there's no cache created on first open. Can you see a ModuleManager.cache n the site/assets/cache folder?
  14. Thanks. But this script isn't used, so it's kinda leftover.
  15. RT @processwire: New blog post: More new core comments upgrades… Admin comment approval by email, user notifications, and more– https://t.c…

  16. Maybe $pages->find("images.tags~='sport-1'");
  17. It comes from htaccess $_GET['it']
  18. Go to root page anand enter names/prefix there.
  19. It works. You might haven't configured all correct. This in the init() method public function init() { if($this->config->ajax && $this->input->it == "webservice/"){ if(!$this->input->action) return; $out = array( "it" => $this->input->it, "action" => $this->input->action, "pageid" => $this->input->pageid, ); header('Content-type: application/json'); echo json_encode($out); exit(); } } and then this jquery ajax call work just fine <script> $(function(){ $.ajax({url:'/webservice/', data: {action: 'getPage', pageid: 1001}, method: 'post'}).success(function(data){ console.log("page", data); }); }); Nothing wrong with the PageNotFound as far as I can tell I'm using both approaches
  20. 500 server error hints at htaccess. should have plenty of threads about 500 and htaccess.
  21. And is there a hidden form-builder page in the site tree?
  22. Is there a form-builder.php in site/templates folder?
  23. You don't really have to hook page not found... just check for ajax and a POST var in the init() of a autload module as I wrote before ... public function init(){ if(!$this->config->ajax) return; if($this->input->webservice){ $id = $this->input->id; echo json_encode(array("status" => "ok", "data" => $id)); exit; } } and you would call a url like your root http://domain.com/?mywebservice&id=10 or using post works with same code
×
×
  • Create New...