Dynamically Filter by Field content

7 posts by 2 authors in: Forums > CMS Builder
Last Post: March 25, 2011   (RSS)

Re: [Pixels & Beats] Dynamically Filter by Field content

By Jason - March 22, 2011

Hi Paul,

To clarify, are you trying to create a search form of drop down boxes based on possible values from the database? If so, how is this information being stored (ie, do you have a list of engine sizes stored in a separate section, or is it just a list inside the scooter section)?

Let me know and I'll see if I can help you get started.

Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Dynamically Filter by Field content

Hi Jason,

For the Model Family I want to display the first scooter in the list. So there will be one example of each Model Family which will form a list for people to choose from. When they click on an example, they will then go to a page listing all members of that Model Family.

As for the other 'filters' yes drop down is what I plan to use but open the other methods.

All information is stored in each individual bike array. So the bike array contains the engine size, model family, etc.

Hope this makes sense if not I will check my mail from home later and try to clarify any points for you.

Thanks for getting back to me :)

Paul

Re: [Pixels & Beats] Dynamically Filter by Field content

By Jason - March 22, 2011

Hi Paul,

How is the information being structured in CMS Builder. For example, for the model field in the bike section, is this a dropdown that is pulling from a model section, or is it a drop down where you typed in all the options into the field.

Let me know
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Dynamically Filter by Field content

Hi Jason,

For the Model Range I added a list field into the bike section which I then populated with all the models in the list options section.

I have attached some photos to try and help :)

Kind regards

Paul
Attachments:

main.jpg 111K

model-range.jpg 36K

Re: [Pixels & Beats] Dynamically Filter by Field content

By Jason - March 23, 2011

Hi Paul,

Okay, in that case, you can use the function getListOptions to get the possible list options that you have stored in the CMS. You're code to set up a drop down box for model_range, for example, would look like this:

<select name = "model_range" >

<?php foreach (getListOptions('bikes', 'model_range') as $value => $label): ?>

<option value = "<?php echo $value;?>" <?php selectedIf($value, @$_REQUEST['model_range']);?>><?php echo $label; ?></option>

<?php endforeach ?>

</select>


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Dynamically Filter by Field content

Thanks Jason!

This looks like a good starting point. Will investigate after the weekend. Hope you have a good one!

Paul