Jump to content
ridgedale

[Solved] PW3 - Dropdown Selector Field

Recommended Posts

Reference: PW 3.0.111 and uikit3 based site using the Regular-Master profile.

I am trying to add a field that provides a dropdown menu but there are no Options or Selector(s) type available - see attached image of field types available.

The following reference under the docs does not appear to be applicable any more:

https://processwire.com/api/modules/select-options-fieldtype/

I can't see how to achieve this. Any assistance would be appreciated.

PW3-FieldTypesAvailable.png

Share this post


Link to post
Share on other sites

Just go to Modules > Admin and install the Select Options Module, then you can select it in the list of available Fieldtypes

  • Like 6

Share this post


Link to post
Share on other sites

@bernhard ,

Thanks for the prompt reply and apologies for my oversight. I must be getting tired, I thought I had checked the core modules. 😞

I'm a little surprised that module is not installed by default. Is there a particular reason it isn't?

Share this post


Link to post
Share on other sites
28 minutes ago, ridgedale said:

I'm a little surprised that module is not installed by default. Is there a particular reason it isn't?

The reason (at least how I read ryan's responses to questions about the options field type) is that more often than not, a page field is the better (i.e. more flexible and extensible) solution when you want to allow the user to make a choice. Having the field type installed by default would probably tempt users to start using it right away without learning to appreciate the power and ease of page fields. There are a few use cases for the options field type, like simple dropdowns in frontend forms (that's where I use them). But a page reference field supports drag&drop reordering of options for editors, it's easy to give the template for the selectable pages a PHP template too to list all pages with that option, you can publish and unpublish "options" without deleting/adding them, regular editors can do that (and add/remove options) without a need to mess with the field's configuration, and the API side is much more intuitive and flexible too...

  • Like 4

Share this post


Link to post
Share on other sites

@BitPoet ,

Thanks for the clarification. That's greatly appreciated.

3 minutes ago, BitPoet said:

There are a few use cases for the options field type, like simple dropdowns in frontend forms (that's where I use them).

That's how I'm intending using it. So I'm glad I'm on the right track.

Many thanks again for your reply.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Roberts R
      I have simple page structure:
      category subcategory simple-product simple-product simple-product simple-product subcategory .... category2 so Im at category page and running
      $pages->find("template=simple-product, has_parent=$page, limit=8"); and it returns 0 pages
       
      but this returns 4 pages
      $pages->find("template=simple-product, has_parent=$page"); Can someone explain why limit does not work here?
      EDIT:
      So I did some tests and it seems that any limit=n where n is >= actual page count that is possible ... selector return 0 results.
    • By DV-JF
      Hi, 
      I'm using this kind of setup (https://processwire.com/blog/posts/language-access-control-and-more-special-permissions/#language-page-edit-permissions) in order to control the page edit permissions. Now I'm wondering if it's possible to hide the "none-ediable" language-tabs instead of striking them through.

      Many greets...
       
    • By VeiJari
      Hello forum,
      This is really a weird one, because front end editing works in a earlier website we did to a customer. 
      When I check the source code for current website it does initiate front end edit: 
      <span id=pw-edit-1 class='pw-edit pw-edit-InputfieldPageTitle' data-name=title data-page=1021 data-lang='1017' style='position:relative'><span class=pw-edit-orig>Tekijät</span><span class=pw-edit-copy id=pw-editor-title-1021 style='display:none;-webkit-user-select:text;user- select:text;' contenteditable>Tekijät</span></span>  But when I double click nothing happens (yes I'm 100% sure I'm superuser and logged in)
      I also tried to apply the front end with other methods than:
      $page->edit('title'); But didn't work either.
      We are using jquery 2.2.4, so it should not be a problem.
      Is this a bug related to current master or something else?
      Someone else having this problem as well?
    • By Lmwt
      Hi there,
      I am new to PW but already very convinced. I need to build a dropdown button to browse in a collection of authors by country and language. The dropdown should be editable in the BACK and displayed on the same as the authors collection. I tried my luck with "PageField Creator" but I don't know how to display the dropdown, I simply used: 
      "$content .=$page->Land;" (the name of the select field)
      but nothing is displayed...
      I see there is a 2nd module out there to achieve this : "Select Options Fieldtype". I am not sure what is the difference, anyone has a tip?
      And a clear tutorial with the necessary steps to build this? I am a bit confused which should be the parent template or page, if it should have a file or not...
      Thanks a lot in advance!
    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
×
×
  • Create New...