I have a block view that I only want to display content that was created as a certain content type.
Also, I want to filter the content based on what page you are on.
I am adding content as Related Links (content type is related_links) which has a field to define page types. You multiple select the page types (which is Taxonomy vocabulary) that you want that content to appear.
In my view, I have an argument set up for the page type.
Is there code that I should put in the Argument Handling Code in the view or should I put code in the Page specific visibility settings within the Block?
Right now, all of the content is showing up. I only want related_links content to show up that has a page type selected that matches the page that I am on. I can determine the page that I am on by the url alias path.
Any suggestions?
Comments
Assuming you're using views -
Did you add a filter for Node: Type? That's the simplest way to limit the content types returned.
------------------------------
http://fraggles.artsci.wustl.edu (Drupal user documentation and development blog)
What about Page Type
I am using the node:type and that helped my only display a specific content type but I also want to only display certain content based on the page you are on.
When you create the content with this type you select the page type (taxonomy) that you want this content to appear.
I am passing the page type as an argument and I am guessing I need to add some argument handling code.
I want to do something similar to a related nodes block (http://drupal.org/node/65375) but I want to determine how it is related.
I am not sure what to put here. I want to compare the argument with the page type of the page you are on.
For example is I want the content to show up on page types (taxonomy) news and press releases. the page type is multiple select it would have to be some loop statement that compares all of the page types selected to the page type that you are on (ie http://drupal.org/news - news in this case is the url alias)
Deborah Fuzetto
I am looking for a simmilar answer
what id liek to see is a module that adds a Page Specific Visibility section to basic content,
So if i have 2 pieces of content (call them "con1" and "con 2" )that display in a block called "Picture"
and i tell "con 1" only be visible when your on the page witht he url called "Page_1"
and "con 2" when your on the page url "Page_2" ,
the block would then only display the "con1" when your at "h t t p://www.mysite.com/Page_1"
this way you could just set any piece of content to show on specific pages in the block, and you could place that single block in a region across all your pages pulling only the content required by the url.
You can do exactly this with
You can do exactly this with the views module using arguments and argument handling code for 2 block views.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
*_*
Use relation in the view with some views relation modules as relations are not available in views 1.0
Regards.
:)
Beautifulmind
Regards.
🪷 Beautifulmind