By gomesh on
Hi friends ,
When I select a state from drop down menu on header, all information regarding state (i.e if i select West Bengal state) came on the page . But for this i have to create content of states , and also I want that information can be submit through admin only . And when that state page displays , 5 link also present on that page(i.e Overviews of state , Tenders of state , Events of state , News of state , Case Study of state ) . Is there any way in drupal to do this task . I am using a views module , but unable to generate a 5 links on state page . I am a newbie please help me .
Comments
Please someone help me . Or
Please someone help me .
Or any helpful link which can help me .
This is achievable. Sounds
This is achievable. Sounds like a good candidate for nodereference and Views Attach modules, though your description is not entirely clear. Are the five links to pages within your Drupal instance?
Thanks for your reply . Yes
Thanks for your reply .
Yes when page of states description displays then 5 link or button you can say on that page also appears (i.e Overviews of state , Tenders of state , Events of state , News of state , Case Study of state ) but only when i enter data through create content State . Is there any way to show the screen shot to you i didn't found any file upload option .
This thread outlines a few
This thread outlines a few options for sharing screenshots: http://drupal.org/node/151132
ok , I attach the screen
ok ,
I attach the screen image please see it .
ok , you can see in
ok ,
you can see in screen1 http://www.gomeshagrawal.com/Screen1.jpg this is my site in which i want to add one link of State . When I click on a state link , drop down menu of 29 states of India is open. After that when I click any state from drop down menu (for ex. if i select West Bengal state) http://www.gomeshagrawal.com/Screen2.jpg then all information regarding state came on the page . But for this i want that information can be changed i.e news ,events , tenders any time by admin only . And when that state page displays , 5 link also present on that page(i.e Overviews , Tenders , Events , News , Case Study) . Is there any way in drupal to do this task . I am using a views module , but unable to generate a 5 links on state page . I am a newbie please help me .
thanks
hi, Is there any one who can
hi,
Is there any one who can help me , i am still waiting .
Conditional field
Did you try with this module. http://drupal.org/project/conditional_fields
Am not fully about your requirement but this module will get you started.
------------
Regards
Ciril
Sreyas IT Solutions
Drupal Server Administration
------------------
Ciril Sreedhar
Sreyas IT Solutions
Server Administration | Web Designing | Web Programming
Thanks for your reply Ciril
Thanks for your reply Ciril .
But my requirement is simple I want state link in header having dropdown menu of 28 states . when i click any state all the information regarding state came on that page including 5 to 6 link (i.e overview , tenders , news event etc. ) on that page . If you see my 2 screen shots then requirement should be clear . This conditional module doesn't help me .
The first thing that occurred
The first thing that occurred to me was setting up a Views block display with an argument based on a nodereference field. You could have a "State" content type, and an "Info" content type. Info nodes would reference State nodes. This would then dynamically populate a block to contain links to Info nodes that reference the particular State node that is being viewed. The only drawback to this solution is that the sidebar will disappear when viewing the Info nodes.
An alternative solution is to build a giant menu with states as parents, and info nodes as children. You could then use the Menu Block module (http://drupal.org/project/menu_block) to dynamically populate links in a sidebar.
hi ArtistConk can you please
hi ArtistConk
can you please elaborate this step by step way , I didn't understant fully . how can i use Views block display with an argument based on a nodereference field .
2 content types: State and
2 content types: State and Info
1. create the State content type and create at least two States
2. Make sure nodereference module is enabled under CCK.
3. Create the Info content type and add a nodereference field under "manage fields" (You may want to select the autocomplete option here for a cleaner display). "Content types that can be referenced" = State
4. Start adding Info pages for the states you've added (2 info nodes for each state should be enough to demo the functionality). For each info node, select the state it's associated with using the nodereference field.
5. Create a new view: type = node (you could call this view "State Links")
6. Add a Block display to the view
7. Under Fields: add node title, remove the Label, and select the "Link this field to it's node" option - Update default display
8. Under Filters: you'll probably at least want to select Node: Published or Admin
9. Under Block settings: Admin, select a block title (i.e. State Links)
10. Under Arguments, select the nodereference field. Choose: Provide default argument; node id from url; Validator: node - state. Then Update default display.
11. Save the View.
12. Go to admin/build/block and place the State Links block in the appropriate region.
13. save the blocks configuration, and then navigate to a State node that has info references. You should now see links in the sidebar that reference that particular State.
hi , when I configure block on the
hi ,
when I configure block on the left side bar . I did't see any state link in the sidebar .
I want to know about 2 things .
1 . I didn't understand point 4 , I add 2 state UP & WB and i create 2 info page i.e overview and tender but how can i connect this info page to state.
2 . I also create 1 taxonomy vocabulary state and add 25 terms into it , how can i use this in view .
I didn't understand point 4 ,
You connect the info pages to a state using the cck nodereference field created in step 3. This field is then utilized in the View settings described in step 10.
I'm not sure what you mean by this. But you should see taxonomy options in several places in the View settings. You need to make sure the taxonomy terms are being used on nodes before you can do much with them. This can be found in the Vocabulary settings by editing the Vocabulary and selecting the types of nodes that the taxonomy should appear on.
This video shows a method of utilizing nodereference fields: http://mustardseedmedia.com/podcast/episode37
It's slightly different from what you're after, but might help in understanding the use of nodereference fields with Views arguments.
ok, One thing i also ask when
ok,
One thing i also ask when i enable the block , then nothing can be appears on left sidebar.
hmmm. All I can offer is that
hmmm. All I can offer is that you go back through the instructions and double-check that all of the settings are correct. It's a pretty involved set-up, so it can be tricky to get right. If that doesn't do it, you could post an export of the view so I can review the settings.
I post an export of the view
I post an export of the view state links. Please check it .
$view = new view;
$view->name = 'state_links';
$view->description = 'Show links of info';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'field_state_nid' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '%1',
'breadcrumb' => '',
'default_argument_type' => 'user',
'default_argument' => '',
'validate_type' => 'node',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'field_state_nid',
'table' => 'node_data_field_state',
'field' => 'field_state_nid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_fixed' => '',
'default_argument_user' => 0,
'default_argument_php' => '',
'validate_argument_node_type' => array(
'state' => 'state',
'event' => 0,
'info' => 0,
'page' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nids',
'validate_argument_vocabulary' => array(
'2' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
),
));
$handler->override_option('filters', array(
'status_extra' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status_extra',
'table' => 'node',
'field' => 'status_extra',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('block_description', 'State Links');
$handler->override_option('block_caching', -1);
In views under Arguments
In views under Arguments settings , i select content: State .
Is this correct because it is a nodereference field , as you said in point no. 10 .
correct
correct
Try this: $view = new
Try this:
$view = new view;
$view->name = 'state_links';
$view->description = 'Show links of info';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'field_state_nid' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '%1',
'breadcrumb' => '',
'default_argument_type' => 'node',
'default_argument' => '',
'validate_type' => 'node',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'field_state_nid',
'table' => 'node_data_field_state',
'field' => 'field_state_nid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_fixed' => '',
'default_argument_user' => 0,
'default_argument_php' => '',
'validate_argument_node_type' => array(
'state' => 'state',
'info' => 0,
'link' => 0,
'page' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
'override' => array(
'button' => 'Override',
),
),
));
$handler->override_option('filters', array(
'status_extra' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status_extra',
'table' => 'node',
'field' => 'status_extra',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('title', 'Links');
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('block_description', 'State Links');
$handler->override_option('block_caching', -1);
"It's slightly different from
"It's slightly different from what you're after"
Actually i also write before that i want one state link on header or left side bar and when i put curser of mouse on that link drop down menu of 25 states is also open therefore I used taxonomy .
Please reply me
Please reply me
You can achieve this by
You can achieve this by adding a "States" menu item to the primary menu (assuming that's the menu used in that space). Make sure the "Expanded" option is checked for the States menu item. For each state, you would add a new menu item to the primary menu as a child of the States menu item. You can customize the primary menu here: admin/build/menu-customize/primary-links
ok , thanks Will you check my
ok ,
thanks
Will you check my view export , is there any error .
Pls tell me why my view block state links not enable .
Looks like you may have
Looks like you may have missed the updated view export. It's pasted above.
when i save the view then i
when i save the view then i click on export button then this code is generated , which i pasted before.
Is there any other way to export data from view .
You're exporting correctly.
You're exporting correctly. What you want to do now is import the updated View that I posted into your site. Let me know how it works out.
Thanks your updated view is
Thanks your updated view is working and show the blocks .
ok ,But i want to ask one
ok ,
But i want to ask one more thing , I want this list of states is in drop down menu in the navigation link only . That is on front page in a navigation list it also shows one link state , when i put curser of mouse on that link then list of states is open in a drop down menu . how can i do this .
One error in this view is when i create a about us page then also it attach to the State list .
I believe I answered your
I believe I answered your first question already:
I'm not sure I follow the second question, but this would indicate that whatever system you're using to generate a State List has also been implemented (mistakenly or unintended) on the About Us page.
I'm not sure I follow the
I'm not sure I follow the second question, but this would indicate that whatever system you're using to generate a State List has also been implemented (mistakenly or unintended) on the About Us page.
what is the solution .
Find out where the overlap is
Find out where the overlap is and then find a way to remove the overlap.