-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
Help with IMPLODE (different output of last page)
Soma replied to Hajosch's topic in Getting Started
This is the shortest method using implode(): if($page->authors->count) echo $page->authors->implode("; ", "<a href='{url}'>{title}</a>") . "."; -
No idea. What module and version are you using? And btw /xxx is not a page name. Also PW uses trailing slash (default).
-
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
-
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.
-
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."
-
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");
-
Selector "children.count" includes unpublished pages.
Soma replied to Tom.'s topic in API & Templates
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"); -
Maybe just use this module? https://modules.processwire.com/modules/textformatter-video-embed/
-
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 .....
-
How do I make ProcessWire display the 404 "page not found" page?
Soma replied to ryan's topic in API & Templates
I can't reproduce this. It's status 404. -
There's a special block in the PW htaccess commented out to redirect all requests to https if it's not.
-
-
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?
-
Maybe you should post this in the Duplicator module thread....
-
-
Can't reproduce it.
-
Works just fine. What is your setup? Where is this field etc?
-
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();
- 11 replies
-
- 7
-
-
- pagination
- get
-
(and 2 more)
Tagged with:
-
Process Memory is going high and admin panel is becoming slow
Soma replied to Mirza's topic in General Support
- 1 reply
-
- 1
-
-
- large pages
- slow performance
-
(and 2 more)
Tagged with:
-
Language Page Edit Permissions - Problem with creating new Pages
Soma replied to Orkun's topic in General Support
I filed an issue on github. https://github.com/processwire/processwire-issues/issues/631