Select field type?
Posted 04 November 2011 - 12:43 PM
I'm wanting to make a list of types of images a user can have, such as:
wallpaper, screenshot, abstract, ...
Because of this some might overlap, so I may need a multiple select (haven't decided definately yet).
Posted 09 November 2011 - 11:57 AM
I read the post at: http://processwire.c...opic,245.0.html to possibly use the module plugin for this and saw your reason for not having selects in processwire.
The only thing is I dont need the "select" pagetype or children to show up as pages, as I would just use it for my own custom filtering code. Right now there is no option to do this quickly, I have to select each page and child page and go into settings>status and check off "hidden" and "unpublished". If there was a option under "children" for each page to set the status for all children that would make things faster. I'm sure others would like this feature as well
Nevermind I notice if the pages are set to "hidden" or "unpublished" those fields wont show in the select.
I was able to set the parent as hidden and that keep the children from showing up in the sitemap though
//edited to prevent-double posting. Please use 'modify'/'edit' function in future, thank you, Adam.
Posted 10 November 2011 - 05:57 AM
It doesn't feel "right" the first few times you do it, but when you think that all it actually stores in the database is a title and page ID, it's not like it's wasting space or anything (that was my initial concern) and also adds the flexibility for clients to potentially be able to reorder their own select lists or add to them etc.
It's really flexible, it just takes a little while to get your brain around the idea of thinking it's wrong
Posted 10 November 2011 - 10:06 AM
<?php $results = $pages->find("field=$page"); // replace 'field' with field name echo $results->render();
Posted 24 February 2012 - 11:03 AM
It does take a littel while to wrap your head around it (or at least it did with me) but on a larger site I'm working on I have a "Tools" section that's hidden (I think that was possibly ryan's suggestion) and then just had different sets of pages under there that form the basis of various selects. It doesn't feel "right" the first few times you do it, but when you think that all it actually stores in the database is a title and page ID, it's not like it's wasting space or anything (that was my initial concern) and also adds the flexibility for clients to potentially be able to reorder their own select lists or add to them etc. It's really flexible, it just takes a little while to get your brain around the idea of thinking it's wrong
Just a suggestion -- it would be good to add this to your tutorials list. It's an important part of what a lot of people are going to want to build.
Took me a long time to find the relevant posts in the forums. Your reasoning and solutions are great, just difficult to find and time consuming to sift through the threads.
Posted 26 February 2012 - 10:26 PM
Right now I'm building a simple events calendar and want to allow people to enter an event's time in 15 minute increments via a dropdown menu.
Choose start time:
In this instance you would put a "times" section under your tools section and create a page for each time you want to use in the dropdown, correct?
Posted 27 February 2012 - 10:33 AM
Posted 27 February 2012 - 12:30 PM
If you wanted something quick 'n dirty, you might also use a small text field and spell out what I was wanting from the site editor in the field's description. During output, if the value doesn't match the expected format then you skip it or substitute a default.
Posted 27 February 2012 - 04:44 PM
There's actually a module for normal selects that can be configured in the field settings: http://processwire.c...-aka-drop-down/
Thanks, I did see that. It might be a better fit in this situation. I'm a little hesitant to use too many custom modules starting out (third-party or my own). In previous systems I've used, relying on too many external modules can quickly make it difficult to upgrade.
You end up having to wait until all modules are made compatible, either by you or someone else. I've found it's better to try and max out the stock options first.
Posted 18 March 2012 - 08:57 AM
I've asked a question about the coding for selects here, in case it helps anyone else as newb as me (is there anyone as newb as me!).
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users