Jump to content

Search the Community

Showing results for tags 'filters'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • 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


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 6 results

  1. Hi, I'm really struggling with this as it's something not in my wheelhouse. I'm creating a blog style page (a grid of cards) which has attributes. I have a snip of javascript which grabs values from checkboxes which are put into a value like the below: ?content=static_video&channel=facebook-ads_instagram-ads document.querySelector("form").onsubmit=ev=>{ ev.preventDefault(); let o={}; ev.target.querySelectorAll("[name]:checked").forEach(el=>{ (o[el.name]=o[el.name]||[]).push(el.value)}) console.log(location.pathname+"?"+ Object.entries(o).map(([v,f])=> v+"="+f.join("_")).join("&") ); document.location.href = location.pathname+"?"+ Object.entries(o).map(([v,f])=> v+"="+f.join("_")).join("&"); } As I'm currently refeshing the page on button click with those values the end result includes the location but can easily remove this. I then use this value in "input->get" to get the values which I then append to a find() rule. See code below: $selector = "template='adbank_pages',sort=published,include=all,status!=hidden"; // Get the channel and content inputs $channel = $input->get->channel; $content = $input->get->content; if($channel){ // Grab the channel string, explode into an array for checkbox checking and then replace _ with | to create or rules in the selector. $chanArray = explode("_", $channel); $chan = $channel = str_replace('_', '|', $channel); $selector = $selector .= ",ab_channels=$chan"; } if($content){ // Grab the content string, explode into an array for checkbox checking and then replace _ with | to create or rules in the selector. $contArray = explode("_", $content); $cont = $content = str_replace('_', '|', $content); $selector = $selector .= ",ab_content=$cont"; } if($input->get){ // If a valid input result $all = $pages->find($selector); } }else{ // If no input show them all $all = $page->children("template='adbank_pages',sort=-published,include=all,status!=hidden"); } $items = $all->find("limit=12"); // Limit the output and use pagination As mentioned above I currently refresh the page to adjust the $selector filter within the $all with a fallback $all if there are no results. I know I need to use AJAX to filter the content without refresh but I am really struggling with the set up. I have read multiple posts including the original by Ryan but still confused. If anyone can direct/help on this it would be appreciated. Thank you
  2. Hi guys I guess this is the right forum to post my question. If not, do let me know. Ok, I'm fairly new to ProcessWire and so far I really like the CMS! It's magnificent to use and really straight forward. Big thanks to Ryan for that. Now, the question I have. I have a template called 'products_categories.php' in which I collect and render all the different categories (the categories basically act as a filter) for a variety of products and next to the categories, I render all the products, like so: <?php include('includes/header.php') ?> <?php $categoryName = $sanitizer->pageName($input->urlSegment(1)); $subcategoryName = $sanitizer->pageName($input->urlSegment(2)); pre($categoryName); pre($subcategoryName); $categories = $page->get("template=products_categories"); $category = $categories->get("template=products_categories_item, name=" . $categoryName); if($category->id){ $session->category = $category->id; $subcategory = $category->get("template=products_categories_item, name=" . $subcategoryName); if($subcategory->id){ $session->subcategory = $subcategory->id; } } $selector = "template=products_item"; if($category->id){ $selector .= ", products_categories=" . $category; } if(isset($subcategory->id)){ $selector .= ", products_categories=" . $subcategory; } $products_items = $page->find($selector); ?> <div class="uk-section"> <div class="uk-container"> <?php if(!empty($page->headline)) { ?> <h1><?= $page->headline ?></h1> <?php } ?> <!-- **** COMMENT: create grid for products **** ---> <div class="row"> <div class="col-md-3"> <div class="uk-card mr-3 uk-card-default uk-card-body"> <h3 class="uk-card-title">Productcategorieën</h3> <ul class="uk-list"> <?php foreach($categories->children() as $c){ ?> <li class="<?= ($category->id===$c->id ? 'active ' : '') ?>"> <a href="<?= $page->url . $c->name . '/' ?>"><?= $c->title; ?></a> <?php if($c->hasChildren){ ?> <ul> <?php foreach($c->children() as $sc) {?> <li class="<?= ($category->id==$c->id && $subcategory->id==$sc->id ? 'active ' : '') ?>"> <a href="<?= $page->url . $c->name . '/' . $sc->name . '/' ?>"><?= $sc->title; ?></a> </li> <?php } ?> </ul> <?php } ?> </li> <?php } ?> </ul> </div> </div> <div class="col-md-9"> <div class="uk-child-width-1-3@s uk-grid-match uk-grid-margin-small uk-grid-small" uk-grid> <?php foreach($products_items as $product) { ?> <div class="uk-card"> <?php if(isset($product->image)) { ?> <div class="uk-card-media-top"> <img src="<?= $product->image->URL; ?>" title="<?= $product->title; ?>" alt="<?= $product->intro; ?>"> </div> <?php } ?> <?php if(!empty($product->title) || !empty($product->intro)) { ?> <div class="uk-card-body uk-card-default"> <?php if(!empty($product->title)) { ?> <h3 class="uk-card-title"><?= $product->title; ?></h3> <?php } ?> <?php if(!empty($product->intro)) { ?> <p><?= $product->intro; ?></p> <?php } ?> <?php if (!empty($product->price)): ?> <h3 class="uk-card-title">&euro;&nbsp;<?= $product->price; ?>&nbsp;(excl. btw)</h3> <?php endif; ?> <a class="uk-button uk-button-primary" href="<?= $product->url; ?>">Bekijk</a> </div> <?php } ?> </div> <?php } ?> </div> </div> </div> </div> </div> <?php include('includes/footer.php'); ?> Now, I can't seem to get the filter to work. The URL behind every (sub)category should go straight back to the template 'products_categories.php', that way I can get a range of products according to the selected/ clicked URL. What am I missing here? Is this not the correct way to handle things? Any help is welcome! Thanks. Cédric
  3. I need some help in understanding how filters work with PW pages and templates. I need to convert this HTML template to PW. Here is a working example. That specific page is giving me nightmares. What I think I know so far: the front-end doesn't bother me, I have that covered each single hotel page has its features/facilities/characteristics those features/facilities/characteristics should be in the single-hotel template a hotel index listing template should be created to hold an index of all the hotels(paginated) Now, do I need a sidebar template to hold the PHP logic of the filter or is that part of the hotel index?
  4. Hi! I was thinking that it would be great to improve and give more options to the Page FieldType. I was thinking the following: The Asm Select and PageListSelect could have more config options of how pages are listed, sorted and named (independent of those Pages' options). This could lead to list pages with different sort options to the ones defined in the parent page. I found that having the option to have a field image to represent the page helps a lot to link to page galleries. This is very custom and I understand PW is meant to be very open to how data is presented. A search filter of some kind (similar to ACF for Wordpress) could improve selecting pages in sites with many pages as well. This could apply to both Asm Select and PageListSelect as well. With Select, there's the Chosen implementation which looks good. Maybe I'm thinking too out of the box, but I think ACF relations widget (image attached) could fit into PW in a way that it can display pages in a non hierarchical way. Maybe listing all pages with template "X" could be shown this way. Pages with template "X" could be all over the Page tree and difficult to find and to sort. I am sure you've all heard of ACF for Wordpress which I think has some very cool ideas about fields as well. I think some parts of the UI are actually very good to handle content for clients and not tech-savvy users as well. What do you think?
  5. hi there! I started with the basic PW template and now I have this site tree, it has the categories (apartments, houses etc...) then I have pages that will work as option for the articles, these options are presented in the article as a select input field type. For example objective field name is called option_objective in my article template. root Properties (articles-list-all) - Apartments (articles-parent) -- apartment one (article) -- apartment two - Houses -- house one -- house two Objective (options-template) - Sell - Rent Type of deal (options-template) - Commercial property - Private property Other options (options-template) - other option one ----------------------------------- Page name (template name) To filter and render the results similar to skyscraper's site profile I looked at how selectors work and also at the skycrapper and Macrura's from the speaker's shop example. I can generate the options to select input fields in the frontend but I can't generate the results page. The following is a part of what I have at the moment. I have this part to generate one of the article's option in the search_form.php <option value=''>Any</option> <?php foreach($pages->get("/objective/")->children("id!=1594") as $objective) { $selected = $objective->id == $input->whitelist->objective ? " selected='selected' " : ''; echo "<option$selected value='{$objective->id}'>{$objective->title}</option>"; } Part of the search_results.php $matches = $pages->find("template=article, title|body|objective~=$q, limit=20"); $count = count($matches); echo $out; Thanks in advance for the help.
  6. Hi everyone. I really need help /guidance knowing if this can be done and what direction I need to take. I have a week to develop and deploy a front end music catalog. I have some limited experience with PW, developing only very small sites....nothing of this magnitude and complexity. If you could guide me to the technologies I need to look at and point me in the right direction, I will be very appreciative. I need to create a searchable page for essentially a music catalog which will pull information from artist's pages. Each track / entry needs to have a number of sections associated with it (track title, length, genre, publisher, songwriter, mood), and maybe an external-pointing link to lyrics. Each line / track will also have to have a play button and link to the music purchasing page for that particular artist. All those sections / fields listed above need to be able to be searched / filtered as well. Easier if I just show you a link to something similar. http://www.noideaband.com/songlist/ That is a WP module and I want that basic look / feel / functionality. It needs to basically pull all of the music files / products from individual pages and into the catalog I don't know. Maybe I am in over-my-head but I am really not sure where to start :/ So here is the site structure I must have: Home - Music Catalog (contains all the songs/artists on the website. This must be a searchable database front-end) - Artists -Artist Name (contains info about artist, etc) -Album 1(contains individual tracks, bio, genre, lyrics, etc) -Album 2 -etc Thanks in advance for whatever information you can bring to the table.
  • Create New...