how to send view menu path as parameter - drupal-7

I define a menu in drupal7 that look something like:
school
--people
----teachers
----pupils
I create:
Content type for people.
Menu with the above titles.
When I add person to people’s content, I choose if he belong to
'teachers' or 'pupils' in the menu.
Now I need that pressing on the menu will give me a list of all that kind of people.
For example, pressing on ‘school->people->teachers’ will give me the list of all
the teachers, one line for each teacher.
So I thing to build a view that get the menu/sub menu as parameter and give me the
appropriate output.
But I don’t know how:
Send to a view the menu / sub menu as parameters. (How to send parameters to a view)
How to filter the view by this parameter and create the specific page.

Create 2 views pages (teacher and pupils)
Where you will show list of all the teachers or pupils
In menu ----teachers add path on views page teachers.
In menu ----pupils add path on views page pupils.
After click on menu you will redirect to the desired page
Update Watch Duplicate Copy Move

Related

Custom Theme template in Drupal 7

I know, if you want to check the names of the Display Output of the view page then we need to click on the Information Link near by Theme of Advance Theme of the view, it will list all the files.
After clicking on this, it will list.
Display Output : (View Machine name is add_to_cart)
views-view.tpl.php, views-view--add-to-cart.tpl.php, views-view--default.tpl.php, views-view--default.tpl.php, views-view--page.tpl.php, views-view--add-to-cart--page.tpl.php
So, could you please suggest which files should be best for creation of the Display Output template of the view page ?
If you want specific theming to your page display of add_to_cart view, then choose
to override views-view--add-to-cart--page.tpl.php.
I'll also want to add the importance of naming convention for templates, so that, next time, you can choose the template name yourself:
views-view.tpl.php: called for every view.
views-view--add-to-cart.tpl.php: called for only add_to_cart view.
views-view--default.tpl.php: called for the display: default(master display) of every view.
views-view--page.tpl.php: called for the display: page of every view.
views-view--add-to-cart--page.tpl.php: called for the display: page of only add_to_cart view. (the specific suggestions are always last)
Note:
Template naming suggestion flow: general to specific.
Also when you click the display output, you can copy the code for the template. This way you get all the variables that are available to you.
Hope this help else comment for queries.
Understanding how default, page comes in template names:
Within a view, you can create many displays as shown below.
Each display has a Machine Name, for eg: System display has a machine name: system_1. So, a view with system_1 display will be overrided using views-view--system-1.tpl.php. Note: the underscore('_') is replaced with hyphen('-'). The by default view display or master display in a view has a machine name: default.

Drupal 7 – not able to change path in "edit menu link"

I am building a navigation menu in drupal 7 and in a few of the menu links it is not possible to edit the "path" in the page "Edit menu links" (under Structure -> Menu -> Navigation). Instead there is a fixed path to for ex. "Add new basic page".
These links also have the option "reset" in stead of "delete"... under Structure -> Menus.
I realize that I must have brought this problem on myself, but I am stuck and cannot figure out how to change the path for these menu links.
So I would like to change the "path". Can someone point me in the right direction?
Just turn off the menu item and create a new one which will fit your need.
This particular menu item was probably created using views. Go into the view and modify the menu item for the related view under Page settings

Drupal 7 - Entity Reference - Display only items related to node that is related to another node

I have 3 Content Types: Restaurant, Menu, and Menu Item.
I've set up my Restaurant content type so that when a 'Restaurant' is created I have the ability to create a Menu with Menu Items, using the Entity Reference and Inline Entity Form modules. This is all working well.
The part I can't get to work is to display the Menu items correctly in the 'Restaurant' page.
I created a Menu View block, where I added Menu Item fields, and filter it by Content Type 'Menu Items'.
When I place this block in my restaurant page, I see all menu items being displayed...
How can I display only the Menu Items that are related to the Menu content type that related to the Restaurant being viewed?
Edit:
In my 'Restaurant' content type I created a field_menu which is an Entity Reference to the Menu content type, and I use the Inline Entity Form module to allow the creation of 'Menu' entities within the 'Restaurant' creation page.
Similarly, in my 'Menu' content type I have a field_menu_item which is and Entity Reference to the Menu Item content type.
In that case you should add the relationship between menu items and restaurants in order to access the field menu in the menu items view. You can do this in the Advanced area relationships and add the entity references that you need. In your case you should add the menu referencing field and the restaurant referencing field. They should appear similar to
Entity Reference: Referencing entity
A bridge to the Content entity that is referencing Content via menu_item_field
All the above should result in the appearance of the menu field in the filters of the view. When the menu field will be accessible in the filter of the block view you should add a contextual filter for that field.
Then in your contextual filter in the "When the filter value is NOT in the URL" area select "Provide default value" and Type "PHP code" (You should have enable php filter for this). In your php code area you should have the following code
$node=menu_get_object();
return $node->field_your_machine_field_name['und'][0]['target_id']; // this is the field you will use for filttering.It should be the menu field in the restaurant content type
Hope i didn't confuse you. It's not a simple task though.

how to use view ticker in drupal

Does anyone explain me how I can use Views Ticker.I loaded modul but no idea how I should use it.please explain me step by step ,I am new on drupal
thank you.I wanna do somethink like this link
enter link description here
Create a "content type" and name it anything in my own case I will name it "news"
To create a content type, navigate to administration->structure->Content type-> add content type
You can add new fields to the content type if you wish. But in my own case I will just use the default settings, since I need only the titles to appear as flash news headlines so click "save"
Next create a new view and name it anything in my own case I will call it "headlines"
To create a new view navigate to administration->structure->views->add new view,
Now setup the new view with the following attribiutes; {View Name = headlines, show = content, of type = news, sort by = Newest First, create a page = uncheck, display format = Views Ticker, of = Titles (Linked)", use a pager = unchecked, create a block = checked} now click save and exit
Next navigate to Blocks and enable the block we just created through the views. Check for the block name "headlines" and specify the location where you will like to place the newly added block and save.
To enable the block navigate to Administration->Structure->Blocks
Now Navigate to view and select the new view we just added. In my own case it is called "headlines" and make sure "Format" is set to View Ticker, you can customize the settings of the View Tick by click settings.
Next add a news content type using the content type we just created. Add a title, a summary and a content. Then hit save
To add a news content type, navigate to Add content
Tip: Add at least two news contents in other to see the full effect of the view ticker
There is "Some" documentation in the readme file. check it out and see if it fits your requirements, http://drupalcode.org/project/views_ticker.git/blob/refs/heads/7.x-2.x:/README.txt
From first glance it seems like a views plugin so you could probably try changing the dispaly in the views settings.
Yes, you need to create a new View that pulls in some kind of content (i.e. Announcements). Under the "Display Format" when creating the View, you'll see an option of "Views Ticker", if you've installed the module correctly.
Based on the example you pointed to, you'll probably want to create a Block at the same time, that you can insert into the desired region.
Once you've created the View, you'll see a link for the Display Format "Settings". This is where you choose whether to make it scroll horizontally, vertically, speed, etc.
Once you updated and saved the view, you should go Admin > Structure > Blocks and insert your newly-made Views Ticker block into one of the regions (regions available will vary based on your Theme).
Then, as long as your permissions are correct, and you have actual content,you should see the scrolling ticker show up on the page(s) where the block shows up.
To use views ticker, it needs you to have an view which outputs some data.
I assume you have such a view. Then go to that view's edit page and set format to views ticker. You should have enabled views ticker module to get that option to formats list.
Then it will show you the settings window, in which you can set settings such as vertically, horizontally, BBC, etc styles for your data movement and respective speed etc.
After you did, click on apply button and then save button top of the view's edit page.
If all goes well it should display moving contents in the page/block related to that view.

add main menu item in drupal 7

I have many content type that I have added in drupal 7 and I want them to be available in main menu. For example I have content types:
news
events
and I want the main menu look like
home - news - events
Despite I checked available menu > main menu
it doesn't show up in the main menu. How can I fix this?
Content types refer to the different types of nodes that you can create. Making your news content type available for the main menu means that, when you create news nodes, you can place them in that menu.
If you are trying to create a page that lists news nodes, you need to look into the Views module. It will allow you to create pages or blocks containing lists of content. Then, you can put those pages in the main menu. You can find the Views module here: http://drupal.org/project/views

Resources