Simple Hierarchical select drupal 7 - drupal

i was created select hierarchy ( taxonomy with 3 level), but in default it's show only one level , how i can display all 3 level in default page? :
-Any- + -Any- + -Any-
I do not want it automatically generates other fields! I want to display by default all the select input

Simple Hierarchical select works on the basis of taxonomy term hierarchical structure, meaning consider you selected a term which has child in first drop down. As soon as you select term which has a child term, another drop down box will appear and if you select a term within that box which has another child term in-turn then another drop down will appear. This process continues to any deeper level. So displaying all drop down box by default is not possible as it depends upon user selection in first drop down.
In your case, as far as attached screen shot considered, first drop down's default value is 'none' and as you know 'none' value wont have any child item. So no default display of all drop down.
If you want you could do this, go to your Content Type's 'Manage Fields' section and edit Simple Hierarchical Select field and select default value which has child terms other than none.

Related

Drupal 7 DraggableViews order

I have 2 separate views for the image gallery having categorize using term.
One for admin(draggable) and second for anonymous user. Admin can change
order(weight) of the gallery.
I am using this weight in second views but this is not working properly
Even i have added SORT CRITERIA on **Draggableviews: Weight (asc)** in
both views.
Is there any way to add as a field weight so that i can debug this issue or any other solution
Only solution that worked for me was the following:
go to your content type/vocabulary
add a weight field (label: weight | machine name: weight | field type: integer
edit your sorting view and add sort criteria for your newly added weight field
edit your draggable views field and change "Handler" from Native to FieldAPI
under Field select your weight field
go to your content view and add the new weight field as you sort criteria
This is the only thing that worked for me. If it doesn't work immediately, just reorder a few items on your draggable view so that the ordering values are reset.
Hope this works for you too.
The draggableviews module doesn't use the weight field for sorting. If you have followed the instructions for using the draggableviews module you should have two views, 1 for sorting with the draggable items and 1 for displaying the sorted view. It is important that on both your views you should have the 'DraggableViews: Order' as the FIRST sort criteria.
As a final extra step, you'll go back to your regular page display for the view and add "DraggableViews: Order" at the Sort criteria section and place it as the first Sort criteria. For sorting order, choose "Ascending".
https://drupal.org/node/283498

Drupal views exposed input as form select (/jumpmenu)

I have content type called news. I have a view thats lists all the news. But now I would like to filter those by year and type. User could select from select menu / dropdown the publish year (2010, 2011, 2012 so on) and also the type of the news (taxonymy terms).
I was playing around with views exposed but I only got a text input field. Can I somehow get a select menu instead of normal input field? And also how can I list all the publish years when news are published to that select menu?
Should this be done even with views?
====
PAGE
Filter dropdowns: -type- -year-
Press releaseses listed down here according the filters.
Select boxes will only be used in Views exposed filters when there is a finite number of possible values. In other words, if your field you want to filter on has something set in the 'allowed values' section you should have the option of a select box if you choose "FIELD NAME - Allowed Values" as the field to filter on in Views.
If your field has an unlimited amount of possible values, you could always write a custom module to create a block with a form that presents your select boxes and directs the user to the view (using the filter parameters of the view).

How to automatically select the taxonomy parent term if child term is selected in Drupal 7?

I have a vocabulary displayed as checklist that has both parent and child terms like:
Parent 1
Child1.1
Child1.2
Parent 2
Child2.1
Child2.2
Child2.3
My requirement is to have the parent term disabled by default. In case user selects any of the child term, the parent gets automatically selected.
Suggestions?
You can modify the value of the reference field on save. If node entity use hook_node_presave().
First get the original tid & load it using taxonomy_term_load() to get term object, get parent id from that and replace it in the reference field.
The Term Reference Tree Widget Module provides a nice interface for selecting terms and gives an options to select the parent term when selecting the child.

Hiding Section in InfoPath 2003

I am creating an infopath form in 2003 where I only want certain sections/controls to appear based on the users choice. I am aware that there are rules and conditions that will have to be applied to this, however I have already added all of the section/fields that need to appear when a user selects an option from the dropdown. My main question is, how do I hide this info on the form? At the moment when I select 'Preview Form' ALL of the sections appear and no option has been chosen yet. How do I hide these until a user makes a selection. I hope answering this question, will help me with the rest of the form.
Thank You~
You are allowed to specify multiple conditions in the conditional formatting options for a section. The easiest way for the section to be hidden on load is to set the conditional formatting for the section to your normal rules OR is blank.
So for example - you have a dropdown that has members Select, Show, Hide. Your conditional formatting on the section should be hide whenever Hide is chosen OR hide whenever Select is chosen (note that the default value of Select for a dropdown is "is blank").
Let's assume you have 1 drop down list and 2 section. Initially the 2 sections should be hidden, when the user selects a value from the drop down list you will show one of these 2 sections based on the ddl selected value.
Add a field to your schema called firstTime with default value 0.
Section 1 will be hidden if firstTime = 0 or ddlChoice = 2
Section 2 will be hidden if firstTime = 0 or ddlChoice = 1
When the ddl index changes set firstTime to 1. This way the first part of the condition won't have any effect and you will only depend on the value of the drop down list to show / hide the sections.

Drupal: Views: how to group fields

I've created a views of node and I've selected the "fields" option in order to select which fields to display and in which order.
Is there a way to group such fields ? It would be very useful to have parent divs in my html code.
thanks
There's a simpler way to do it: http://www.arsnova.cc/web-development-articles/2012-07-27/grouping-fields-together-drupal-views
Let's say you want to group fields 1-3 together within a div.
First, exclude fields 1 and 2 from display. (By "exclude", I do not mean to delete them from the views display; rather, click on the "exclude from display" button within each field's options.) The fields you exclude from display must come before the other field for this to work. If they don't, rearrange them so they do.
Go to field 3, and rewrite the results, inserting the token for each of fields 1-3.
That's all you need to do. Fields 1, 2, and 3 will now appear within field 3's div. If you want, you can also add additional markup within the "rewrite results" area.
Recently found the best way for my needs and apparently for the needs of many people:
Use views_fieldsets module https://drupal.org/project/views_fieldsets, it allows yo to create a grouping div to put fields inside.
Grouping is built into Drupal 8 Views. So no need for any extra modules. Here's how:
Edit your view (be sure it has fields)
Click Format's Settings
A box will pop up with all your selected fields
Look right underneath all the field names, there should be "Grouping field Nr.1"
Select the field you'd like to group by
Click Apply
If you want to subgroup with a second field, just go back to 2 then you'll see "Grouping field Nr.2"
That's it.
Yes, click on the gear next to the Style option (under Basic Settings) and set the Grouping field. Keep in mind, the grouping field needs to be added to the view, but you can check the Exclude from display option to hide it, if needed.
I'm pretty sure that would give you a parent div. If not, you could add the parent div, by overriding the default templates (look to the Theme: Information section, under Basic Settings, for more information).

Resources