Jump to content

Recommended Posts

Posted

Hello. 

I´d like to have an input field where the user can select one of a few choices of currencies. I there any module that can do this?

thanks  :rolleyes:

Posted (edited)

No necessity for a module in this case. Use field type "Page" instead.

In your tree in the ProcessWire admin, add a (hidden, if you want) page called, for example "Currencies". Afterwards add children to them: e.g. USD, EUR, GBP.

Next step: create a field of type "Page" (this will reference pages), limit it to a single value ("Details" tab in the fields properties). On tab "Input", set the "Parent of selectable pages" to the aforementioned, newly created "Currencies" site.

Now you got the functionality you're aiming for. This "page field" can now be assigned to another template.

Advantage of this approach: When you need to add options (a new currency) to your set of currencies, you can just add a page and all the "page field selects" implemented elsewhere will notice that there's a new option.

If this description is too quick and shallow, just give a notice. 

This whole approach is one of ProcessWire's strength and I'd be happy to explain it in more detail :)

Edited by marcus
  • Like 2
  • 2 weeks later...
Posted

thanks for the answer, and sorry for being so late in mine  :-[

your solution is very clear, and is already implemented and working.

thanks!

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...