Jump to content

Search the Community

Showing results for tags 'select'.

  • 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. I see a fieldype made by Hanni; and i have a question with multi language; there's a way to made this fieldtype to save to multiLanguage processwire 2.5.* ? The module is: https://github.com/Hani79/Processwire_FieldType_Select_Drop_Down PD: i know there's a page fieldtype; but i dont wanna use that cause the final user dont need to see a page with 30 children for 1 category dropdown. Regards,
  2. I know there are a lot of category-topics on this forum already, but I can't find a solution for my problem. I got the following page-tree: Downloads - Download 1 - Download 2 - Categories -- Category 1 -- Category 2 --- Subcategory 1 ---- Deeper Subcategory -- Category 3 So categories can be really deep. Each download is assigned to one category only. And I would like to output it in my template like this: Category 1 - Download 1 Category 2 - Subcategory 1 -- Deeper Subcategory --- Download 2 But I can't find a good selection to do so.
  3. Hi again, I have another dummy question about Select field use. I made the field "boardbasis" with select options: 1:=Breakfast 2:=Catered 3:=Self-catered In template I use $page->boardbasis to extract result from "boardbasis" Select field. As a result I get on page "1 or 2 or 3" (just pointed numbers). What should I do achieve as a result "Breakfast or Catered"? Thanks a lot for your assistant. Have a great weekend, a.
  4. Hi! I´m really liking ProcessWire, even though it´s a little intimidating to a complete PHP noob like me. The basics are pretty easy understand, but one function I still lack is the option to sort pages by custom fields. I looked at Ryans Scryscraper Site Profile to try to figure out how he did it for about 5 minutes before my brain exploded. I´ve also tried to search the forums without success. So if this is something that some of you PHP gurus could help me with that would be awesome. Here´s my question. Lets say I have a photos page with lots of photo pages in it which include custom fields such as resolution, camera, size etc.. How would i go about to list them by these fields? For example like this: select -option(Camera model from A-Z) -option(Camera model from Z-A) select -option(Highest resolution) -option(Lowest resolution) select -option(Highest size) -option(Lowest size) [Find] Thank you. /Jan Londén Edit: Here´s the final code. Remember this is an ugly copy/paste version from a non PHP programmer. Use at your own risk, etc.. If anyone wants to improve, make this more elegant, please do. Huge thanks to adrian who helped a lot. <?php /** * Books template * */ include("./head.inc"); $selector = ''; // For the keyword search input. Searches both title and body. if($input->get->keywords) { $value = $sanitizer->selectorValue($input->get->keywords); $selector .= "title|body%=$value, "; $summary["keywords"] = $sanitizer->entities($value); $input->whitelist('keywords', $value); } // For the book publisher select tag. Sorts alphabetically from A to Z. if($input->get->book_publisher == 'desc') { $value = $sanitizer->selectorValue($input->get->book_publisher); $selector .= "sort=book_publisher,"; $summary["book_publisher"] = $sanitizer->entities($value); $input->whitelist('book_publisher', $value); } // From Z to A. elseif($input->get->book_genre == 'asc') { $value = $sanitizer->selectorValue($input->get->book_genre); $selector .= "sort=-book_genre,"; $summary["book_genre"] = $sanitizer->entities($value); $input->whitelist('book_genre', $value); } // For the book chapters select tag. Sorts numerically from highest to lowest number of pages. if($input->get->book_chapters == 'desc') { $value = $sanitizer->selectorValue($input->get->book_chapters); $selector .= "sort=book_chapters,"; $summary["book_chapters"] = $sanitizer->entities($value); $input->whitelist('book_chapters', $value); } // From lowest to highest. elseif($input->get->book_chapters == 'asc') { $value = $sanitizer->selectorValue($input->get->book_chapters); $selector .= "sort=-book_chapters,"; $summary["book_chapters"] = $sanitizer->entities($value); $input->whitelist('book_chapters', $value); } // For the book pages select tag. Sorts numerically from highest to lowest number of pages. if($input->get->book_pages == 'desc') { $value = $sanitizer->selectorValue($input->get->book_pages); $selector .= "sort=book_pages,"; $summary["book_pages"] = $sanitizer->entities($value); $input->whitelist('book_pages', $value); } // From lowest to highest. elseif($input->get->book_pages == 'asc') { $value = $sanitizer->selectorValue($input->get->book_pages); $selector .= "sort=-book_pages,"; $summary["book_pages"] = $sanitizer->entities($value); $input->whitelist('book_pages', $value); } ?> <form id="book_search" method="get" action="<?php echo $config->urls->root?>books/"> <h3>Browse books</h3> <p> <label for="search_keywords">Search</label> <input type="text" name="keywords" id="search_keywords" value="<?php if($input->whitelist->keywords) echo $sanitizer->entities($input->whitelist->keywords); ?>" /> </p> <p> <label for="book_publisher">Publisher</label> <select name="book_publisher" id="book_publisher"> <option value="">Any</option> <option value="desc"<?php if ($input->get->book_publisher == 'desc') { echo ' selected="selected"'; } ?>>Alphabetically A-Z</option> <option value="asc"<?php if ($input->get->book_publisher == 'asc') { echo ' selected="selected"'; } ?>>Alphabetically Z-A</option> </select> </p> <p> <label for="book_chapters">Number of chapters</label> <select name="book_chapters" id="book_chapters"> <option value="">Any</option> <option value="desc"<?php if ($input->get->book_chapters == 'desc') { echo ' selected="selected"'; } ?>>Highest to lowest</option> <option value="asc"<?php if ($input->get->book_chapters == 'asc') { echo ' selected="selected"'; } ?>>Lowest to highest</option> </select> </p> <p> <label for="book_pages">Number of pages</label> <select name="book_pages" id="book_pages"> <option value="">Any</option> <option value="desc"<?php if ($input->get->book_pages == 'desc') { echo ' selected="selected"'; } ?>>Highest to low</option> <option value="asc"<?php if ($input->get->book_pages == 'asc') { echo ' selected="selected"'; } ?>>Lowest to high</option> </select> </p> <p> <input type="submit" id="book_submit" name="submit" value="Find" /> </p> </form> <?php $books = $page->children($selector); ?> <?php if (count($books)) : ?> <ul> <?php foreach($books as $book) : ?> <li> <p> <a href="<?=$book->url?>"><?=$book->title?></a><br> Publisher: <?=$book->book_publisher?><br> Number of chapters: <?=$book->book_chapters?><br> Number of pages: <?=$book->book_pages?> </p> </li> <?php endforeach ?> </ul> <?php else : ?> <p>No books were found.</p> <?php endif ?> <?php include("./foot.inc"); You might need to change desc/asc values to get them working the way you want.
  5. Hi! I'm trying to find optimal solution for "cars database" site I'm currently developing. Background: Each car has variable but limited list of attributes: model, length, number of seats, color, etc - total more than 50 attributes that average consumer is interested to know. Each attribute has value, e.g. model=BMW 3er 318i, length=5.5m, number of seats=5, color=black. These attributes and their values are added in the repeater field of car page, where attributes are selected from available limited list (page select field type) while values are entered manually (text field). Repeater is used because number of required attributes vary from car to car. Problem: Depending on attribute, some value fields need to be "selectable" and some not. For example, if attribute is "color", then available through select values should be "black" and "white". Other value field should not be "selectable", e.g. "length" attribute could have any decimal value. So far, I haven't found an elegant way to make such dependency and value selection (only when it is needed) within repeater. Do you know an elegant way how to make PW work as I need? I'd like to make life of content manager (person who enters cars data into the db) a bit easier. ) Thanks for help!
  6. Sorry for this dummy question, I'm newbie for processwire. I try to make new field for search form from "drop down module" but nothing happens. Take a look: <select id='country' data-placeholder="Country" placeholder="Country" name='country'> <option value=''></option><?php foreach($country as $count){ $selected = $count == $input->whitelist->country ? " selected='selected' " : ''; echo "<option value='$count'>$count</option>";} ?> </select> What am I doing wrong? Cheers, a.
  7. this is the 2nd time i have encountered this issue; the first time i just figured i was doing it wrong; when making the options in a select list, it says: this is my list: engus:=English (US) enguk:=English (UK) french:=French italian:=Italian spanish:=Spanish greek:=Greek but for some reason this is not working...it doesn't store the value when using this kind of list. Does it only work with numbers?, or can we have the stored data be the string on the left (which could be a css class for example) and on the right be able to use a word combination that is more understandable to the user... -marc
  8. Scratching my head here. I'm trying to find a simple way for the client to be able to add options to a select tag in a form. Do I really have to use pages here? I can use a textarea - convert new lines to <li> tags but that won't cut it for <option> tags. Repeater field? If that is the best option could anyone tell me how I would output the results as <li> tags? Ideally it would be a fieldtype where each drop-down was some sort of item that I could loop in <option> tags. Thanks Edit: I've come up with this code for a repeater file and it seems to be doing the trick. <?php echo "<ul>"; foreach ($page->subject_options as $item) { echo "<li>$item->subject_option</li>"; } echo "</ul>"; ?> I would be interested though if there was a faster or 'cleaner' way of doing this.
  9. Sorry to ask a lame question but after trying I've failed to work out the code I need to do something that I am sure must be easy to do with PW but my newb status and PHP/jQ weakness have foiled me :/ I'm using pages to make a 'select' as described here. I'm using a repeater to add two fields to the editor, one a select and the other a textarea. For my template, in my awful pseudo code I want to do this: if segment_width is set { if segment_width = half then output "grid_6" (to fill in a CSS class) if segment_width = third then output grid_4 - - - " - - - if segment_width = quarter then output grid_3 - - - " - - - output the segment field that follows on from the segment_width/is within the same repeater as the segment_width } I assume I will want a foreach or other loop as these repeater panels will be added in pairs or threes or fours and there may be more than one set, e.g.: segment_width (half) segment_width (half) segment_width (third) segment_width (third) segment_width (third) THANK YOU if you're able to point me in the right direction. Cheers, -Alan EDIT: My other post explains what I am trying to do a bit better
×
×
  • Create New...