Jump to content

Dynamic Selects (Commercial Module)


kongondo

Recommended Posts

Hi there,

I was just testing the module out, very cool. I wonder, Is there any way to redirect the latest selection to it's page (on frontend using MarkupDynamicSelects)? For example you select continent, then country, then city and you click on "Go" button which redirects you to the city page you have selected. 

Link to comment
Share on other sites

Hi @Maverick.

Thanks for you custom.

Currently, not out of the box. but should be very easy to achieve using your own JavaScript. It would go something like this

  1. Render your DynamicSelects form
  2. Next to it, in your template file, add your Go button or link
  3. Using JavaScript (e.g. jQuery) disable that button or link
  4. Once a 'last' selection is made, using JavaScript, change the value of your Go button/link to the URL of the last selection. For instance, if a link, we would change its href. 
  5. On click, the user gets redirected to the selected 'URL'.

Initially, I was thinking the developer could build in the 'URL' themselves, i.e. build it client-side using JavaScript, from the select option's label. For instance, if we have a city Berlin, we would build our ProcessWire URL off that. But that is not very friendly. I think it will be better if a I added a third $options argument to MarkupDynamicSelect's render() method. You can then specify what extra info for the results to return, e.g. url was passed in the options, it would result in:

<select>
  <option value='1234' data-url='/continent/country/city-page-1/'>City 1</option>
  <option value='1235' data-url='/continent/country/city-page-2/'>City 2</option>
  <option value='1236' data-url='/continent/country/city-page-3/'>City 3</option>
</select>
   

You would then grab the selected option's data-parameter, e.g. in the case above, data-url, and do whatever you want with it. 

Is there any other value you think would be useful to return other than url? i.e. what other data-xxx would be useful?

Thanks.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Hi @videokid,

Thanks for your interest in the module. Dynamic Selects only works with existing values. So, no, there's no way to input new values. Given that values can be anything from a list of users, to fields, to page titles, file or image names, such a feature will be quite the task to pull off. What did you have in mind?

Link to comment
Share on other sites

Hi @kongondo,

well, currently I have this set-up:

- brands
 |--> Alfa Romeo
     |-> 159

 |--> Volkswagen
     |-> Golf

in the back-end two page-reference fields, option autocomplete:

  [ brand ] [ brand_type ]

So, I was thinking, after choosing the eg VW,  a list of models would come up.... and if there's a new model, just type it in [autocomplete] and it would be added as child under the brand....
Does it make any sense what I'm trying to explain here?

In my case ' page title ' would be sufficient.

Thank you already for your answer!

Link to comment
Share on other sites

  • 6 months later...

Hi @kongondo, I have just purchased the module and started testing it. One thing I ran into immediately is that it does not seem to support multilanguage text fields, even Title does not show up in the Data Source options. Are you aware of this? 

For now I can bypass this by adding an extra single language textfield, but I would expect it to work out of the box. Perhaps just by showing the Default language content.
For large existing multi-lingual sites this could be a big issue.

Link to comment
Share on other sites

Hi @eelkenet.

5 hours ago, eelkenet said:

I have just purchased the module and started testing it.

Thanks for the purchase.

5 hours ago, eelkenet said:

One thing I ran into immediately is that it does not seem to support multilanguage text fields, even Title does not show up in the Data Source options. Are you aware of this?

Yes I am. This will be added in the next version. I'm working on it for the next couple of weeks.

Thanks

  • Like 1
Link to comment
Share on other sites

Dynamic Selects version 005  (released (16/07/2017))

Glad to announce that the latest release of Dynamic Selects is now available for Download/Purchase.

Changelog

  1. Dynamic Selects is now fully multi-lingual! Thanks @eelkenet for reminder :). Relevant fields and labels now shown in user's language if available, with fallback on default if not.

Screenshots

Backend Dynamic Selects Fields

ds_backend_field_edit_ml_version_5.thumb.png.e7f71069e87c0e261ddfcac9ed90d1c1.png

Demo

Backend Dynamic Selects Page Edit

ds_backend_edit_ml_version_5.thumb.gif.7dc3d1dde1f5e90d983f75f7d24079ca.gif

Frontend Dynamic Selects

ds_frontend_ml_version_5.thumb.gif.bd07eac597283696d7d629d77d9391c3.gif

  • Like 4
Link to comment
Share on other sites

  • 1 month later...

Renewals and Resend Links

Hi,

Renewal and resend links pages for Dynamic Selects have been added. Use renewals if you wish to renew a Dynamic Selects order whose subscription has expired (1 year). Resend are for orders that are yet to expire. Use this if you can't find or didn't get the confirmation email sent after your purchase.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

Will this module work in a repeater?

My use case is that the client needs to make a selection of a page, and then if that page has any children, it will show those as selectable.
But they may need to do this multiple times on one page, hence the need for repeater support.

I tried using the built in dependent select, e.g. parent=page.page_select_field, but this doesn't seem to work in a repeater (still references the edited page i think)...

  • Like 1
Link to comment
Share on other sites

6 hours ago, Macrura said:

Will this module work in a repeater?

I have never tried it in a repeater but I do have my doubts. I'll test and let you know. 

Edit: I've just tested...and, we'll what do you know, it works! Well, mostly :).  I'll just need to sort out an issue similar to this one in VPS (a solution exists [scroll down a couple of posts]; just needs to be implemented). Otherwise, at the moment, the selections are affecting each other (selects have identical IDs since they are just being, er, repeated). No ETA for now though, but definitely on the cards.

Thanks for your interest.

Link to comment
Share on other sites

  • 1 month later...

Hi @hezmann,

Thanks for the purchase.

I've just tested in ProcessWire 3.0.85 and it works fine.

  1. What's your setup? ProcessWire version?
  2. What's the name of your multi page field?
  3. Is that multi page field setup properly? (i.e., does it work fine outside DS)
  4. Are other page fields (single and multi) listed for selection?
Link to comment
Share on other sites

On 1/29/2018 at 3:17 PM, kongondo said:

Hi @hezmann,

Thanks for the purchase.

I've just tested in ProcessWire 3.0.85 and it works fine.

  1. What's your setup? ProcessWire version?
  2. What's the name of your multi page field?
  3. Is that multi page field setup properly? (i.e., does it work fine outside DS)
  4. Are other page fields (single and multi) listed for selection?

Hi @kongondo,

Thanks for getting back to me.  I figured out (duh!) that I actually needed to create the regions field to store the information - when I did that it came up in the third data source.  However, it's now coming up blank even though there are pages (ie  I have Europe->Germany->Bavaria but that's not showing up in the drop-down).  So, in answer to your questions..

  1. ProcessWire 3.0.62
  2. regions
  3. it is setup now and does work outside DS
  4. yes

Thanks!

Link to comment
Share on other sites

7 hours ago, hezmann said:

However, it's now coming up blank even though there are pages (ie  I have Europe->Germany->Bavaria but that's not showing up in the drop-down).

Hi @hezmann

OK, progress! Good :).

Just to be clear. 

  1. You have a page called Europe
  2. You have a page called Germany and its parent is Europe
  3. Inside the template used by the page Germany, you have a page field called regions.
  4. The page field regions has been set up to allow for selection of pages meeting a certain criteria (I mean the page field settings, not DS)
  5. Editing the page Germany, in the field regions, is Bavaria selected and saved for Germany? A screenshot of your regions field when editing Germany would help, thanks
  6. Is Bavaria published?

If the answer to #5 is NO, then Bavaria needs to be saved for Germany. DS only returns saved values. 

A screenshot of your page tree showing Europe Germany and Bavaria would be helpful too.

If the above doesn't resolve the issue, is the site remote? Any chance I could get a temporary login to have a look?

Thanks.

Link to comment
Share on other sites

1 hour ago, hezmann said:

I actually have a page Bavaria with a parent Germany with a parent Europe.  Can it work like that? 

Thanks.

Yes, it can, but I am a bit confused. What is the role of the page field called regions then? From your description, you need the following relationships

  1. continent > none
  2. country > child
  3. region > child

Relationships are read 'backwards', so to speak. So, region (e.g. Bavaria) is a child of country  (e.g. Germany) and country is a child of continent (e.g. Europe). Continent has no 'backward' relationship (none). 

As for values for country and region, you can select any valid (as per DS docs) field to display for the selected child. E.g. title, population, etc, as long as those fields are present in that page. If they are present but not populated, then the select (i.e. the DS inputfield you see when you edit the page with the DS field) will be empty.

If you still can't get it to work, could you please post a screenshot of your page tree, Germany, Bavaria and the Details Tab shot of your field regions? If you wish, you can also PM these or email them to me. 

Link to comment
Share on other sites

I think I get your setup now. 

Europe
	Germany (has page field 'regions' whose selectable pages are its children)
    		Bavaria
        	Hamburg
        	Thuringia

My previous solution is for when you want to list regions in a country where a 'hike' is possible. What you are after, I think, is to show only the regional hikes that have been undertaken/completed in a specific country. For instance, in the country Germany, you have several pages saved in its page field 'regions'. Those saved pages are the regions where hikes have been completed.

If this is the case, then you'd have to do it a little bit differently. I'll get back to you later with suggestions. Thanks.

Edited by kongondo
Link to comment
Share on other sites

I'm more cataloging long distance hikes around the world.  Some are only in one region - ie King Ludwig's Way which is in Bavaria, some are much longer and pass through multiple countries/regions - ie any of the GR routes.  I was able to get the select working using 

 

image.thumb.png.b33e0dff3eaca0a2b76a3039d77aebfe.png

 

The information is being stored in the database as seen here...

 

image.png.2fd9bfc94c052a7c6a706da8e6e8faa2.png

 

But for some strange reason I can't filter it with Lister...

image.png.87b4154cde538db95fd0971bfbf11e93.png

 

Link to comment
Share on other sites

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...