Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Testing this, I'm not seeing any problems with what you're saying. Link abstraction works here. Though it's an experimental feature and not sure where this leads to, same as with this module. Highly experimental.
  2. I can't reproduce this one, it's working fine here. What versions are you using? What is the error?
  3. Thanks for the report. I was having trouble with it and it wouldn't work with the offset. I was wondering. Now that you mention it, maybe it has to do cause I used limit 2? I will have a look at it again cause maybe it's a bug.
  4. Sorry for being so ignorant but I can't seem to find where PW 2.8.x is. Any hints?
  5. Why would do that? This code doesn't make sense. User is already logged in and $session->login() requires a user and password. So your code always returns "NULL" thus does not a redirect. // after login redirect user to another page if($session->login($user)) { // login successful $session->redirect("/"); } I also would expect a success message after saving. Also a validation of password length and requirement would be needed. With this code I could have a passwort like "abc". Such code examples are dangerous...
  6. Why no prefix? I would rather use the Pager with a blank PageArray and trick it a little. Configure your prefix to use something unique like "toreplaceprefix". Set your template to allow page numbers AND url segments. Then do something like this: $limit = 2; $start = $input->urlSegment1 ? ($input->urlSegment1 - 1) * $limit : 0; $pageNum = $input->urlSegment1 ? : 1; // page number for pager $pa = $pages->find("template=basic-page, start=$start, limit=$limit"); foreach($pa as $p){ $content .= "<p>$p->title</p>"; } $pagination = new PageArray(); $pagination->setTotal($pa->getTotal()); $pagination->setLimit($limit); $pagination->setStart($pageNum); $pagerHTML = $pagination->renderPager(array( "baseUrl" => $page->url, )); $pagerHTML = str_replace("toreplaceprefix", "", $pagerHTML); $content .= $pagerHTML;
  7. RT @leonidlezner: @processwire I could convince two people to switch to ProcessWire this week! My screencast helps me to spread the awesome…

  8. @xwolf @MadeMyDay warum ist dieser Blog nur 2/3 breit und Zelenlänge nur 20 Zeichen auf meinem natel? Schade hätte den Art. gerne gelesen.

  9. You mean you haven't? Shame on you really! Well you check for $languages more than 1 and then cycle each and set "status[langid]" to 1.
  10. When creating a bunch of children via CSV the pages aren't active in the alternative languages. Just caught me.
  11. It doesn't matter it's in a loop or not. And it definately works, I've used it many times with repeaters. Then your problem may lays somewhere else. You also can't assume that next() always returns a page, thus doing something like $page->next()->title is not real world code.
  12. That could be that in memory PageArray filtering doesn't work with count(). Just use a normal find(selector)->count ...
  13. I have a repeater and when doing $firstRepeater = $page->carousel->first(); $content .= $firstRepeater->next(); I can't get the next when I'm not logged in. But with $content .= $firstRepeater->next("check_access=0"); It works. Don't now of anything else that might do the trick.
  14. Then maybe the options field is not .id= but something different. I would try .value= or .data=
  15. Well it does for me.
  16. What you are looking for is rather something like find selector but with count $count = $page->article_overview_flexible_layout->count("article_overview_flexible_layout_type.id=4");
  17. What is $layout? Well if you use a next() , PW will search for the next repeater page and while they're hidden in /admin they're protected. You could try next("check_access=0") to get around that.
  18. You use wire("page") If rendering a repeater field from another page, let's say echo $pages->get(1001)->render("repeater_field"); So in template/fields/repeater_field.php echo "<p>Page containing the repeater: " . $page->title . " " . $page->id . "</p>"; echo "<p>Page currently requested: " . wire("page")->title . " " . wire("page")->id . "</p>"; // render each repeater echo $value->each("<section><h2>{title}</h2>{body}</section>");
  19. RT @smashingmag: ✎ A beginner’s guide to ProcessWire, a free CMS that offers an easy-to-use and powerful API to handle content: https://t.c…

  20. @pwFoo I don't know exactly what you mean by replace links template. But read the documentation with the part for hook to modify item string etc. https://github.com/somatonic/MarkupSimpleNavigation#hook-for-custom-item-string-new-in-120 And various examples around here https://gist.github.com/somatonic/6258081
  21. Something along the way public function init(){ if($this->config->ajax && $this->input->InputfieldMyAjaxBomb){ // handle your ajax request header('Content-Type: application/json'); echo "{'yo':'yo'}"; exit; } } .. in your Inputfield init(). Then you can make a post or get AJAX request to any backend or public url the current url containing the key InputfieldMyAjaxBomb=1. Edit: Originally I didn't really mean that there's "no need". Well, of course a hidden admin ProcessPage bundled with your module is also good and honestly maybe even the more correct way. But It's easy to implement and test things out too.
  22. @tpr http://modules.processwire.com/modules/email-obfuscation/ does what you need. I'm not the creator of this module, and have no plans to develop it further. I will gladly take pull request if anyone has the time to do so.
  23. Awesome stuff indeed. Any chance to get drafts and preview of pages in core working for all fields? It's the most requested feature among projects and clients. Many other cms have this out of the box. We are now telling clients since 5 years that it will be maybe possible soon. Now there's ProDrafts and we can't use it cause it's not working for Repeaters, PageTables and so on.
  24. @yellowled was ist denn das für ein Kunde!? :)

  25. Why do you modify core module? You can enter those in the backend on the configuration of this module.
×
×
  • Create New...