Jump to content

Search the Community

Showing results for tags 'search'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Hello. Earlier I was able to implement a simple search on a knowledge sharing project for my company but now I was asked to add some functionality where to any page some files can be attached. It went pretty straight forward to use the FieldTypeFile and show up on the frontend all attached files by names. After completting the task I thougth that I could expand my search results allowing the query to search for a string within the attached file names and/or description. So on my working query: $matches = $pages->find("template!=keywords,title|body|keywords~=$q, limit=10"); I tried adding the files_upload field which I created and assigned some file types. The final query got: $matches = $pages->find("template!=keywords,title|body|keywords|file_upload~=$q, limit=10"); but I got a long error text: Error: Exception: SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list (in C:\OpenServer\domains\nowknow.pw\wire\core\PageFinder.php line 384) #0 [internal function]: ProcessWire\PageFinder->___find(Object(ProcessWire\Selectors), Array) #1 C:\OpenServer\domains\nowknow.pw\wire\core\Wire.php(374): call_user_func_array(Array, Array) #2 C:\OpenServer\domains\nowknow.pw\wire\core\WireHooks.php(549): ProcessWire\Wire->_callMethod('___find', Array) #3 C:\OpenServer\domains\nowknow.pw\wire\core\Wire.php(399): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageFinder), 'find', Array) #4 C:\OpenServer\domains\nowknow.pw\wire\core\PagesLoader.php(216): ProcessWire\Wire->__call('find', Array) #5 C:\OpenServer\domains\nowknow.pw\wire\core\PagesLoader.php(216): ProcessWire\PageFinder->find(Object(ProcessWire\Selectors), Array) #6 C:\OpenServer\domains\nowknow.pw\wire\core\Pages.php(225): ProcessWire\PagesLoader->find('template!=keywo...', Array) #7 [internal function]: ProcessWire\Pages->_ This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged. Obviously I am not getting the correct way of searching for a file name or file description in the query. Any ideas how to accomplish that?
  2. Hi all. I'm building a product search page with a filter consisting of selects and checkboxes. It's based on Ryan's excellent Skyscraper demo, but I'm trying to add multiple checkbox fieldtypes. I've got it working, but it's not very elegant and I'm sure there's a better way to do it. Given the following checkboxes: [x] Adidas (15) [ ] Asics (10) [x] Nike (20) If only Adidas is checked, 15 shoes will be found; if both Adidas and Nike, 35 shoes will be found. The form field: foreach($pages->get("/brands/")->children() as $brand) { $selected = $brand->name == $input->whitelist->brand ? " checked='checked' " : ""; echo "<label><input $selected type='checkbox' name='brand[]' value='{$brand->name}'> {$brand->title}</label>"; } Here's what I've got for the select, based on the Skyscraper search: $selector = ''; ... if($input->get->brand) { $brands = $input->get->brand; $selector .= "brand="; foreach($brands as $brand) { $value = $brand; $selector .= "$value|"; $input->whitelist('brand', $value); } $selector .= ", "; } ... $selector = "template=product-page, limit=24, " . trim($selector, ", "); This sort of works (although pagination doesn't work because I don't know how to do the whitelist part -- bonus question!). The correct results are returned, but an echo of the selector string looks weird: "template=product-page, limit=24, brand=adidas|nike| " (there's a trailing pipe character that I don't know how to remove). Is there a better way to do this? Thanks in advance.
  3. I really know nothing about ProcessWire, but my site, www.cji.edu, was created with it. On our home page we have a "Search" field. How do you search for a "Date" like "May 5"? "May" by itself doesn't work (maybe it is to short). "June" works by itself but not if you also have a number with it like "June 21". Are there configuration changes that our WebSite Host can make to fix these situations? Thanks.
  4. I have a simple site search using the functions from the default beginner profile in my development site - http://normand.indevelopment.website/ However with debug on I get the following error when trying to SEARCH and then output to the renderNav function. Any ideas? Catchable fatal error: Argument 1 passed to renderNav() must be an instance of PageArray, instance of ProcessWire\PageArray given, called in /home/normandandthomso/public_html/site/templates/search.php on line 52 and defined in /home/normandandthomso/public_html/site/templates/inc/functions.php on line 28
  5. Now that Google is closing down the paid service Google Site Search, and only the free ad version of their search will be available within a year, I have started looking around. It seems that DuckDuckGo has an API that delivers data as JSON. Has anyone used this with ProcessWire and have some code and guidance to offer? Such as listing the results, open for pagination and any other tricks?
  6. Hello PW community, I've a search form which return selected items with pagination. Everything works fine, also the pagination display correctly all results through pages. The issue is given only for selected results pagination as the latter does not start from page 1 but it revert back results from the current page (e.g. if you are in page 3, and submit a result from selects form, than all related items are displayed - not starting from page 1 but from page 3, which means something a fake "no results"). This is the classic function of render pager: echo $works->renderPager(array('arrayToCSV' => false)); Any idea? Thanks! Edit: I've also tried the "start=0" within the selectors, however it Always re-start from page 1 and stick to that, regardless. So no more option to move to page 2, 3, ....
  7. Hello processwire community, this is my very first post, I am newbie in php - trying to test a simple search form which allow frontend user to search and filter data. Macro steps are as follow: 1) Create the form with options as checkboxes, allowing the user to choose multiple values selection within multiple checkbox groups; 2) Create the pw process code in order to revert back the selected items (as a result of multiple checkbox filter combination), allowing pagination as some results may be more than 50 items; --- Here some of the most related topics I've found over PW forum: https://processwire.com/talk/topic/7282-paging-issue-with-html-form-check-boxes/ https://processwire.com/talk/topic/3472-enable-pagination-for-search-results/#comment-38214 https://processwire.com/talk/topic/1883-how-to-use-input-whitelist-with-checkboxes-or-any-array/ https://processwire.com/talk/topic/1547-getting-multiple-checkbox-values-within-processwire/ https://processwire.com/talk/topic/1034-search-form-with-multiple-fields/ https://processwire.com/talk/topic/10193-multiselect-search/ --- Now, the html form works just fine (code below), it brings all checked values to the url string. Essentially I have four different groups of checkboxes: cb_sectors[] (multiple pages as categories); cb_expertise[] (multiple pages as categories); cb_status[] (multiple pages as categories); cb_year[] (integer). The user may select multiple values within the above four checkbox groups, thus creating even quite complex combination. <form name='search' id='search-works' method='get' role='form' action='<?php echo $pages->get('/search/')->url; ?>'> <div class="collapsible-header">Sector</div> <?php foreach($pages->get("/sectors")->children as $sec) echo " <p class='checkbox'> <input type='checkbox' name='cb_sectors[]' value='{$sec->name}' id='{$sec->name}'/> <label for='{$sec->name}'>{$sec->title}</label> </p> " ?> <div class="collapsible-header">Status</div> <?php foreach($pages->get("/taxonomy/Status")->children as $st) echo " <p class='checkbox'> <input type='checkbox' name='cb_status[]' value='{$st->name}' id='{$st->name}' /> <label for='{$st->name}'>{$st->title}</label> </p> " ?> <div class="collapsible-header no-padding">Expertise</div> <?php foreach($pages->get("/expertise")->children as $cb_expertise) $checked = $cb_expertise->name == $input->whitelist->cb_expertise ? " selected='selected' " : ''; echo " <p class='checkbox'> <input type='checkbox' name='cb_expertise[]' value='{$cb_expertise->name}' id='{$cb_expertise->name}' $checked/> <label for='{$cb_expertise->name}'>{$cb_expertise->title}</label> </p> " ?> <div class="collapsible-header no-padding">Year</div> <?php // generate a range of years from '09 to '17, or maybe better doing it via pages as years? for($year = 2009; $year <= 2017; $year += 1){ echo " <p class='checkbox'> <input type='checkbox' name='cb_year[]' value='$year' id='$year' /> <label for='$year'>{$year}</label> </p> "; } ?> <input class="no-class" type="submit" id="search-submit" name="submit" value="Search"> </form> The question is then mostly focusing on the second step, the pw process code: As some previous posts on this topic say - I should (in sequence) sanitize, whitelist and validate the results before pass them to the final output (correct me if I'm wrong). The thing is that I cannot find a way to get all values in a array and sanitize/whitelist/validate them -> some post suggest to use arraytoCSV as a way to let PW remember the filtered items while moving through pagination. Is arraytoCSV the best way to sanitize and whitelist the user input combination? The following code simply get selected values coming from the above form. As you can see, no sanitize nor whitelist nor validation is in place, as without the array the sanitizing function gives back only the last selected value (not the full combination for every group of checkboxes). Can you please help me implementing an array within the following code and the way to sanitize - whitelist - validate "get" values? I know for most of you is just as simple as drinking coffe, but would be great if you could drive me in the right direction. Thank you in advance! <?php namespace ProcessWire; if(count($input->get)) { if($input->get->cb_expertise) { foreach ($input->get->cb_expertise as $expertise) { // here we are just ensuring submitted products are in fact valid echo $expertise; } } if($input->get->cb_sectors) { foreach($input->get->cb_sectors as $sector) { // here we are just ensuring submitted products are in fact valid echo $sector; } } if($input->get->cb_status) { foreach($input->get->cb_status as $status) { // here we are just ensuring submitted products are in fact valid echo $status; } } if($input->get->cb_year) { foreach($input->get->cb_year as $year) { // here we are just ensuring submitted products are in fact valid echo $year; } } } ?>
  8. Hi, I have a site search working correctly on a project, however I seem to be having issue when the search term contains characters such as question marks or brackets. I'm doing the following... $q = $input->get->text('q'); if($q) { $input->whitelist('q', $q); $q = $input->get->selectorValue('q'); } $matches = "search_cache~={$q}, sort=-publish_date"; This works correctly for everything except searches that include characters such as ? or ( ) So for example a searches for the following (where the page title is "example title?") example title example title? The first one works as expected and the second returns 0 results. As the titles are very specific for a user to search, I need to make sure the search works with these kind of characters. How can I make sure search works with these kind of characters?
  9. Sorry if this a bit of a rant. I'm in the last steps of getting our intranet "reborn" on PW, and one still unanswered question is what search backend to use. As with most intranets it holds quite a big number of office and pdf files. I've already tried a few of the major open source search engines like ElasticSearch, Solr, Sphinx and OpenSearchServer, and I found all of them lacking in two regards - for one, the documentation is all over the place so you never know if the piece you're reading even applies to the version you're using, and the implementations of their APIs are just horribly awkward and extremely picky in regards to the slightest deviations from their "standard" (which isn't really concisely documented) syntax. None of them comes with a basic permission system, which is an absolute must have. I can probably work around that with facets or the like, but still... you'd think everybody all over the world but me only indexes public webpages. Design decisions like using JSON objects that have multiple identically named properties make me doubt the sanity of those maintaining the software. Looking at all these points, I'm now also considering rolling my own on top of an InnoDB fulltext index, just re-using the text extractors I've already running in the old system (up to now only feeding the extracted plaintext into a MySQL table and doing literal searches), adding a fulltext index, setting up a lean API module for the few search variants I need and be done with it. That, of course, still leaves the topic of extracting relevant snippets open - should I write my own UDF for that, or are there (functional and maintained) third party extensions available to do just that? A question that warrants some more digging for an educated decision. I'm still a bit torn, but there's also the time factor to consider. If any of you has experiences with searches (especially with implementing visibility of search content using a group-based permission concept) and could throw in a few pointers or experiences, I'd be glad.
  10. Am I right in understanding that there's no way to escape or encode a dash ("-") for use within a selector value (that has to be sanitized)? Looking at the code for $sanitizer it looks like it's just converted to a space. That seemingly makes it impossible to search for terms like "x-ray." Any workarounds for this?
  11. Hello, i am trying to search page with multiple options like, i have one select box where i can select multiple items as <select id="tokenize" name="tokenize" multiple="multiple" class="tokenize-sample" /> i have GET form and when i submit the form i get values like search/?tokenize=abc&tokenize=xyz now in my search page $children = $pages->find("template=property, Ad_Type=".$ptype." ,Area=".$tokenize); as you can see i have passed multiple values of tokenize, how can i search page contains all values ? Thanks
  12. Hello together, currently I’m working on some kind of enhanced search for pages->find in the FRONTEND and I like to ask if someone has a possible solution or hint on how to build it. My problem is, I like to add search strings with a "+" or "-" in front of word and tell PW what to search and what not based on the input of the user. Example: Let say I have the following page tree Airports — NYC, USA — Miami, USA — Tokyio, Japan — Berlin, Germany Let’s say that all pages have more then one body text field but in one of them is a text that contains the words "Airport" and "Air-condition". User enter the following text into an input field: Airport air +USA -nyc My preferences are: 1) find all Airports (or cities) with the word Airport or air in the title OR in the body text of the pages, also find part of the words like fair or air-condition 2) Filter the results of 1) and find only pages with the word USA inside 3) Filter the results of 2) and show only (exclude) the results with a word like nyc As the result only Miami, USA will be displayed, because it got USA and NOT nyc and in the body text are the words Airport and air-condition. For 1) I used the code (see below) from @Mats suggestion https://processwire.com/talk/topic/10883-search-with-and-string/ It searches part of words in the title and body with OR. But what I’m looking for is, how can I search for pages that have the search term AND the term with a "+" before. It finds me Airport but it should only find Airport if +USA is inside title of body text. And of course, how it is possible to exclude a word, for example with a "-" before the search term. In spoken language it would be: Find anything with Airport or air. Show only results containing the word USA and exclude anything from the results with the word nyc. In general, is it possible to exclude something from the search in pages->find and what could be a good start to code such a search function? Thanks so much in advance! Thomas if($q) { $input->whitelist('q', $q); $qs = explode(" ", $q); foreach($qs as $key => $q){ $qs[$key] = $sanitizer->selectorValue($q); } $selector = "template=print, title|body|body_2|body_3%=" . implode("|", $qs) . ", limit=50"; $matches = $pages->find($selector); }
  13. Hey folks, If I search for a page that is unpublished it can not be found by using the ajax search in the right corner in admin. It can only be found when I am logged in as a Superuser, but not if I am logged in as an Editor (who has page-edit rights!). Searching through lister works - but only if I choose to only search unpublished pages; but not via the ajax search at all. I already looked at the process page search module file and there is a line that allows unpublished pages to be searched if someone has paeg-edit rights, but somehow it does not work at all. Can someone help? Thank you so much!
  14. Hey folks, I did some digging to see if I could find anything on this, but I couldn't turn up anything. Does any one have a recommendation on how to track the terms that users enter in my site search? Thanks for any thoughts!
  15. Hi folks, I have a simple search setup, and I'm wanting the order of results to be sorted by parent then created date. I currently have this set up as: sort=-parent, sort=-created And here is a screenshot of my Tree structure from the CMS: However, when I get the search results; the result is putting Portfolio results before People results... any ideas where I am going wrong? I'm thinking it's to do with the fact that a 'person' has the parent 'People' but also 'People & Practice' but then couldn't work out why it was being returned in the order before 'Now'? EDIT: Thinking about it, it's because the ID of Portfolio is 1028 but the People ID is 1048; do I need to do it by sort first, then parent, then created? Thanks in advance, R
  16. I've implemented a site search on a site and am a bit confused about how it processes results. For instance, a search for art union produces no results, same for a search for art, but a search for union produces 5 results including the one I was hoping would come up which has a title of art union. How/why is that happening and is there anything to configure to improve the results? My search form looks like: <form action="<?php echo $pages->get("template=search")->url; ?>" method="get"> <input type="text" name="q"> <button type="submit">Search</button> </form> and the search template: if($q = $sanitizer->selectorValue($input->get->q)) : $input->whitelist('q', $q); $matches = $pages->find("title|body|summary~=$q,template!=admin, limit=50"); $count = count($matches); if($count) : foreach($matches as $m) : … endforeach; endif; else: … endif;
  17. Hi all, i been trying some things with a customized search form and suddenly it throws an SQLSTATE error. can somebody explain what i did wrong? it's the code from the site-classic template... if i leave the selector empty i get all pages in result, if i add any selector it returns this error. <?php $out = ''; if($q = $sanitizer->selectorValue($input->get->q)) { // Send our sanitized query 'q' variable to the whitelist where it will be // picked up and echoed in the search box by the head.inc file. $input->whitelist('q', $q); // Search the title, body and sidebar fields for our query text. // Limit the results to 50 pages. // Exclude results that use the 'admin' template. $matches = $pages->find("title~=$q, limit=50"); $count = count($matches); if($count) { $out .= "<h2>Found $count pages matching your query:</h2>" . "<ul class='nav'>"; foreach($matches as $m) { $out .= "<li><p><a href='{$m->url}'>{$m->title}</a><br />{$m->summary}</p></li>"; } $out .= "</ul>"; } else { $out .= "<h2>Sorry, no results were found.</h2>"; } } else { $out .= "<h2>Please enter a search term in the search box (upper right corner)</h2>"; } ?> thanks in advance, ocr_a
  18. I need to extend the search capability to image descriptions through the default search template in 2.5.3. $matches = $pages->find("title|body|sidebar|thumb_one|thumb_two|thumb_three|thumb_four|gallery_img%=$q, limit=50"); I've added additional field selectors, but with inconsistent results. Is there a better way to achieve this?
  19. Hello! I like to share a project developed using ProcessWire. App-UNIVERSE.net is a modern online service with software database download. We provide access to a rich app database for desktop operating systems based on Windows and Mac OS. Within each category we present both free and commercial apps used by professionals in industries as movie creation, interior design, transportation, creating presentations, coding apps and games, etc. All available apps in App-UNIVERSE contain information like license, name of developer, date of app update, actual description of main features and direct links to files hosted on developers homepage. Site visitors can search for apps not only through the catalog, but also an advanced search engine. Applications can be searched by criteria such as category, developer, name of the application or alternative. Unlike many competing sites we do not offer download of files via download assistant that under the pretext of simplifying the process of installing apps are spying software and are installing in system toolbars and other unnecessary components. We focus primarily on all valuable apps that we can height recommend to our users.
  20. Hi, Having ploblems with this search page code. I'm trying to get all images with tagged with the search query, which works currently. Then get a url and add <a> wrapping the image to a page that references that image in its image_select field - doesnt work. if($input->get->q) { $q = $sanitizer->selectorValue($input->get->q); $input->whitelist('q', $q); } $matches = $pages->find("imageTags.title%=$q, limit=20"); if(count($matches)) { $out .= "<ul class='grid-list'>"; foreach($matches as $m){ // $name = $m->image->name; // $out = $name; // $mWork = $pages->find("image_select=$name, limit=1"); // var_dump($mWork); $out .= "<li>"; // $out .= "<a class='' href='{$mWork->url}'>"; $image = $m->image; $image = $image->width(450); if($image) $out .= "<img src='$image->url'>"; // echo "</a>"; echo "</li>"; } $out .= "</ul>"; }
  21. Hi Guys, I am trying to implement a website that uses processwire as the content management system. I am trying to create a page where stars can be added to a christmas tree, each star is a repeater field and is associated to a modal pop up which displays a message. There may be more stars than what we can physically put on the tree so I have implemented the search function to allow users to search for a name or message in order to find their star. At the minute the search function is showing the results from the repeater fields, I have 2 stars at the minute however only one shows in the search results. 1 star has test in all the fields and the other has mel in each of the fields. I have no idea why only one result will show, any help would be greatly appreciated. The link to the page is as follows: http://www.friendsofthecancercentre.com/wish-upon-a-star/ <?php $out = ''; if($q = $sanitizer->selectorValue($input->get->q)) { // Send our sanitized query 'q' variable to the whitelist where it will be // picked up and echoed in the search box by the head.inc file. $input->whitelist('q', $q); // Search the title, body and sidebar fields for our query text. // Limit the results to 50 pages. // Exclude results that use the 'admin' template. $matches = $pages->find("star.message|star.who|star.from*=$q,"); $count = count($matches); if($count) { $out .= "<h2>Found $count fields matching your query:</h2>" . "<ul class='nav'>"; foreach($matches as $m) { $out .= " <li><p><a href='{$m->url}'>{$m->title}</a><br />{$m->summary}</p></li>"; } $out .= "</ul>"; } else { $out .= "<h2>Sorry, no results were found.</h2>"; } } else { $out .= "<h2>Please enter a search term in the search box (upper right corner)</h2>"; }
  22. I am building off the default install, and noticed that, in practice, the included search template limits me to a single search term (or an exact phrase of more than one word). How can I get it to search a simple boolean-type string, with an AND or OR? The template PHP code: $q = $sanitizer->text($input->get->q); if($q) { $input->whitelist('q', $q); $q = $sanitizer->selectorValue($q); $selector = "title|body|interests~=$q, limit=50"; if($user->isLoggedin()) $selector .= ", has_parent!=2"; $matches = $pages->find($selector); if($matches->count) { $content .= "<h2>Found $matches->count pages matching your query:</h2>"; $content .= renderNavPanel($matches); } else { $content = "<h2>Sorry, no results were found.</h2>"; } } else { $content = "<h2>Please enter a search term in the search box (upper right corner)</h2>"; } I've tried every permutation of entering the data I can think of (x y; x AND y; x&y; x, y; "x" AND "y"; x + y; etc.; etc.) , but whenever I put in more than one search term, I get zero results—even if each of the words, when searched alone, does produce results. I even experimented replacing the two $sanitizer types with bool, but that threw ugly errors. About to pull my hair out over this. I am sure there is a simple answer, but as I haven't worked much with any sort of input features (built static sites for years), I cannot seem to crack it. Forgive me is this if Kindergarten-level. Thanks.
  23. I have a question on how to group search results by template, with pages sorted alphabetical (as standard) in each group. I have a film blog running ProcessWire. It has lots of posts, ratings, categories, ratings, directors, actors and tags, my search result is getting crowded by all this pages after a while. These pages have different templates. Until now I have had badges with the template label by their title in the search result. I am wondering if there's a simple way of coding it to group the search result, kind of like how IMDb does it: Titles are grouped first, then names second. Like this. To illustrate, here's a part of my structure, template name in brackets: --- Main (home) Blog (posts) Movie 1 (post) Movie 2 Actor (actors) Actor 1 (actor) Actor 2 Director (directors) Director 1 (director) Director 2 Tag (tags) Tag 1 (tag) Tag 2 --- And here's how I would want my search result to show, e.g. if all these pages where to mention Tom Hanks somehow: --- Movies: Movie 1 Movie 2 Directors: Director 1 Director 2 Tags: Tag 1 Tag 2 Actors: Actor 1 Actor 2 --- I am in a learning process, and I am sure there are other problems that will appear when considering usability. Limits within groups, etc. But for now this is a way of sorting that I might also want to use elsewhere later on. Whereas I have headings and results in separate lists. (PS: I have read a couple of posts on group sorting based on parent ID, but none of them was exactly what I was looking for.)
  24. I have the following sidebar.inc included on my Shop page which is the main index of items: <?php foreach($input->get as $key => $val) { echo htmlentities("$key = $val") . "<br>"; } $selector = ''; $summary = array( "categories" => "", "agegroups" => "", "keywords" => "", ); if($input->get->categories) {} $sidebar = "<form id='search_form' method='get' action='{$config->urls->root}shop/'><div class='row'>"; $taxonomies = $pages->find("template=product_taxonomies"); foreach($taxonomies as $t) { $items = $t->children; $sidebar .= "<div class='small-6 large-12 columns'><h3>{$t->title}</h3>"; foreach($items as $i) { $sidebar .= "<input id='$i->name' name='$t->name' value='$i->name' type='checkbox'><label for='$i->name'>$i->title</label><br>"; } $sidebar .= "</div>"; } $sidebar .= "<input id='search_keyword' name='keyword' type='text'/>"; $sidebar .= "<div class='large-12 columns'><input type='submit' id='search_submit' name='submit' value='Search'></div></div></form>"; Checking more than one input of the same name only produces the last value of those. Can anyone advise me on how to make these multi-select filters return multiple values?
  25. Hi there, so, I'm quite new to ProcessWire, I am currently building my first site with it, I'm almost done, everything went smoothly.. up until now. I've been trying to build a search function for hours now and I did get it to work after a while, but not in a very satisfactory manner. As a starting point I used the code from the "site-classic" templates, but the problem is: API-calls don't seem to work. It all starts off with if ($q = $sanitizer->selectorValue($input->get->q)) { Which gives me the following "Error: Call to a member function selectorValue() on a non-object" Investigating lead me to finding, that it won't just call selectorValue, but also, that $input->get->q does not exist. Actually $input itself is null and so is $sanitizer. Which also leads me to not being able to whitelist q, as I can't call $input->whitelist() The only way for me to retrieve the query value is via $_GET["q"], which does work. So this was my main issue. Another question would be: in the search template of site-classic it is said: // Search the title, body and sidebar fields for our query text. // Limit the results to 50 pages. // Exclude results that use the 'admin' template. $matches = $pages->find("title|body|sidebar~=$q, limit=50"); But I don't see any constraint actually excluding admin templates. If I enter the term "template" into my search, I get a nice link in my search results into my backend "/processwire/access/permissions/page-template/". How to prevent this? I hope you can help me with my issues. Thanks a lot! a
×
×
  • Create New...