Jump to content

Search the Community

Showing results for tags 'custom field'.

  • 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

Found 3 results

  1. Hi guys, let's assume I'm developing a site (custom theme with custom fields) for my customer, where he can list any articles. For example: Article1 -> item1, item2, item3, item4, etc... Each item is a textfield. Now if I want to add a new item, in this example item5, then I have to clone an existing field in the admin panel and also add this field to pagefile with PHP. If there would be 100 items, do I really have to clone an existing field and add this field to PHP code everytime? But my main question is: if my customer want's to add a new item (on the admin panel with own user), is there a way that he can clone an existing field (item) and edit the text inside and publish this field on the site, without customizing with PHP?
  2. Hi all! My first post here, and I'm pretty new to the PW thing, even if I'm falling in love with it . Currently, I'm making a portal with PW and trying to add a few custom fields to the users' profile (image, socials, etc.). The issue here is that I'm able to add custom fields to the user profile, but PW doesn't save the values into these fields. It does let me insert the text or upload the image, but doesn't stores them into the database. And no error is printed out. By looking into the network traffic I did find that in some case it returns a JSON response: {"error":false,"message":"AJAX Page not saved (no changes)"} I've searched/googled about this particular issue but didn't find anything about it. I also have tried the solution described in this other topic (https://processwire.com/talk/topic/1002-cant-upload-imagefiles-problem/) to try in solving the image issue at least, without any good result. I thought the problem was maybe connected to the file permissions on the local installation, but the same situation has verified on remote test installation. I'm using latest stable PW version on WAMP: Apache v2.4.9 PHP v5.5.12 MySQL v5.6.17 Any idea, friends? Thanks.
  3. 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.
×
×
  • Create New...