I've got a question in drupal. I have two filters. The values of the 2nd filter depends on what value was chosen in the first filter.
Example.
First filter values : Lakers,Clippers
Second filter values : if Lakers was chosen = KOBE,GASOL
if Clippers was chosen = PAUL,GRIFFIN .
Is there any module that supports this? Or do I have to code this? If I do is there any reference or guide that I could read and follow?
THANKS!
Yes there is
Drupal has a module called hierarchical select.
check this out
https://drupal.org/project/hierarchical_select.
Hope this helps you.
Don't use hierachical select. It is chock full of bugs and since the maintainer went to work for Acquia, he no longer pays any attention to it. You'll have to write some code to make this work using contextual filters.
Related
I am using ui-select in AngularJS to show select options from given values. I want to display a choice when there is no search result. Is there any way to accomplish this task?
you can use ui-select-no-choice. It should be used right after ui-select-choices. Refer to official documentation i have included link.
<ui-select-no-choice>
Sorry! No choices found!!
</ui-select-no-choice>
Reference : ui-select-no-choice
I would like to style a couple of elements using a filter to decipher if it should be yellow or red.
I understand filters should not carry logic operations in them as such so am guessing a service is the first port of call before i create any filter for it.
I am leveraging data from a backend (still a bit unsure of the Backend model here, but know I can leverage certain objects to obtain the data needed for working on) I mostly need to know if i`m on the right path by using a service to control the logical outcome and then a filter to provide 'filtration' of that outcome.
BTW: sorry, im waiting for my project to checkout from SVN at mo so cannot provide a skeleton attempt.
Will do in a bit though .....
Any advice before hand will be much appreciated
:) Gruffy - thanks for reading
You can directly set the class attribute if you want, so your filter can simply return the CSS class to apply:
<p class="{{'foo'|myFilter}}">Foo</p>
Here's a fiddle showing what I mean.
I'm trying to create a content type that allows me to post multiple images from an external database in this sort of style: http://www.newageman.co.uk/14-time-travelling-celebrities
In an ideal world this is what I would like my group of fields to look like in the article creation screen.
http://oi57.tinypic.com/wi0z8i.jpg
Any idea how I would achieve this using best practices? To post articles like this I'm currently using a piece of php code but it's confusing for my contributors, so would like to use fields. I've never made a module or custom field before.
Thank you!
I have done something similar using the Field Group module, you may give it a try.
Hello friends a pleasure to be around here, I'm new to this framework and I have a few doubts about how to make dependent dropdown, for example, I have a list of countries and select a country to show me their states hope I can help from already thank you very much.
Here is a demo of what you're looking for:
http://demo39.agiletoolkit.org/demo.html?t=20
Could it be that above example (http://demo39.agiletoolkit.org/demo.html?t=20)
only works when the arrays have numbers for their dropdown values? ie:
$country_list=array(1=>'Country1', 2=>'Country2')
$state_list=array(1=>array('st1','st2'),2=>array('st3')
night it be the demo will not work when using:
$country_list=array('COUNTRY1'=>'Country1','COUNTRY2'=>'Country2')
$state_list=array('COUNTRY1'=>array('ST1'=>'st1','ST2'=>'st2'),'COUNTRY2'=>array('ST3'=>'st3')
with the second setup I get an error at form submit time saying:
Value 'ST3' is not one of the offered values
or am I doing something else wrong? should I (not) use stickyGET for instance?
I need to build a filter search that returns data using the criteria set.
My problem is building the search. It needs to be a OR query because anyone of them could be selected.
http://img200.imageshack.us/img200/2527/screenshot20100118at095.png
This is what will be searched.
Accommodation.space
Accommodation.room_type
Accommodation.facilities
Accommodation.speaks
The only way I can think of doing it is an if statement for each input, but that would be 15 if statements, is there a better way?
$Model->postConditions($this->data) [reference] can do this for you.
It will auto-generate Cake compatable conditions array, and you can even specify if you want it to be an "AND/OR" operation
This is a nice component which could likely be tweaked to work for you. It might even work right "out of the box"
http://www.jamesfairhurst.co.uk/posts/view/cakephp_filter_component/
Here is a new tutorial about this. Might help: http://www.youtube.com/watch?v=FAVuLXFVaCw