Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. This is the shortest method using implode(): if($page->authors->count) echo $page->authors->implode("; ", "<a href='{url}'>{title}</a>") . ".";
  2. No idea. What module and version are you using? And btw /xxx is not a page name. Also PW uses trailing slash (default).
  3. It actually only adds active to the active nav item. All parents of the active nav items get "parent". The first options in MSN. https://github.com/somatonic/MarkupSimpleNavigation#same-with-comments $options = array( 'parent_class' => 'parent', // overwrite class name for current parent levels
  4. You would just have to find out if your on "Solutions", then use that (the current page) as the root for the MSN. SO it renders only children of Solutions. You can get the level you're on also by using $page->parents->count which Would be 1 for Solutions, 2 for Solutions Overview. So there's no options to do what you want, you'd have to find out the condition via some logik and then simply use another root parent page.
  5. All nice and I know there's ways to get around it, but the Site has no content to crawl, just empty html. And if JS is not enabled you see this: "This is your fallback content in case JavaScript fails to load."
  6. I think Tom is right. Inputfield render is the inputfield markup not the whole <html>. Why not just use the core scripts array? $this->wire("config")->scripts->add("/xxx/xxx.js");
  7. I think this is by design to optimize queries. But not sure. It uses COUNT in SQL to evaluate children counts which don't check for page status, I can imagine on very large sets it could get slow? Anyway this case is rare you really need this and have access aware. What is your use case exactly? You can always just loop the pages in question and check for $page->numChildren(true) which is access aware. (You could also store/cache that info in a real field on the page with some hooks and use that.) Some example with numChildren() $res = $pages->find("template=basic-page"); foreach($res as $r){ $r->has_children = $r->numChildren(true) > 1 ? "true" : "false" ; } echo " | has children: " . $res->find("has_children=true"); echo " | no children: " . $res->find("has_children=false");
  8. Maybe just use this module? https://modules.processwire.com/modules/textformatter-video-embed/
  9. It's not a bulk redirection of all to home... RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} All urls redirect to its same url just https. Your code doesn't work and doesn't make sense here at all cause you redirect /about to /about to /about to /about to /about .....
  10. I can't reproduce this. It's status 404.
  11. There's a special block in the PW htaccess commented out to redirect all requests to https if it's not.
  12. Why not just use PageTable field?
  13. Do you mean this? (ProcessPageEditImageSelect)
  14. It's all there. When I was starting with PW years ago, I very soon looked at modules and all the Process modules that make the admin. So I never really needed a tutorial, just look and learn copy and try. It was so simple and since it's all in the same fashion using the already familiar API and "normal" modules. So you have a ton of modules Ryan has already built that make ProcessWIre backend you can use as examples/learning. Isn't it nice?
  15. Maybe you should post this in the Duplicator module thread....
  16. Have you installed both modules? It looks like it's not as automatic as it could be.
  17. Well funny thing is i also tested in 3.0.98 and it works.
  18. I would install a new PW and test it. If it works it's something with your installation, maybe some settings or module?
  19. There's not special permission. page-view and page-edit the usuals. Yes it's in a repeater-matrix.
  20. Can't reproduce it.
  21. Works just fine. What is your setup? Where is this field etc?
  22. Make sure you have a filter form that action url is the $page->url. I don't know what the problem is really but it's all getting too complicated for what it really can be (dead simple). Example filter form for a paginated result list : <?php namespace ProcessWire; $filter = ""; $form = $modules->InputfieldForm; $form->attr("action", $page->url); $form->attr("method", "get"); // select with sort options $f = $modules->InputfieldSelect; $f->attr("name", "sort"); $f->label = "Sort"; $f->addOptions(array( "-title" => "descending", "title" => "ascending" )); $form->add($f); // submit button $f = $modules->InputfieldSubmit; $f->attr("name", "filter"); $form->add($f); // process form if(count($input->get)){ // processes and populates form fields $form->processInput($input->get); // if sort is not empty if($form->get("sort")->value) { // build filter and add to whitelist so it gets picked up by pagination $input->whitelist("sort", $sanitizer->selectorValue($form->get("sort")->value)); $filter .= ",sort=" . $input->whitelist("sort"); } } $result = $pages->find("template=basic-page, limit=2{$filter}"); $content .= "<h2>Show Results</h2>"; if(!$result->count) { $content .= "<p>no results</p>"; } else { foreach($result as $res){ $content .= "<p>$res->title<br>$res->url</p>"; } $content .= $result->renderPager(); } $content .= $form->render();
  23. I filed an issue on github. https://github.com/processwire/processwire-issues/issues/631
×
×
  • Create New...