How to know the link clicked by the user to set the breadcrumb using views in drupal 7? - drupal-7

I'll try to explain my problem giving a little context first.
I'm building a catalog of products and to categorize them I'm using a taxonomy tree with 4 sublevels. Each product can be related with one or more subcategories.
I used views to navigate the taxonomy tree to access the products related with each subcategory. To manage the breadcrumbs in here I redefined the hook_breadcrumb() function on my template.php and this is working perfectly.
The problems start here: when I get to the last level of subcategories I have the respective products and when I click one of the products it will enter the node page of that product. At this time I lose my breadcrumb trail because I entered the node. I could get the taxonomy tree of that product to build the breadcrumbs but the problem is that the product can be related with multiple subcategory terms.
So, in order to solve this problem I think that I need to know from wich path trail the visitor arrived to the product. In other words, I need to know the last taxonomy subcategory that the user visited to enter a specific product so that I can build the breadcrumbs correctly with that information.
So, can someone help me on how to know the path that the user was before entering a node?
Thanks in advance!

You can check http://drupal.org/project/cookiecrumbs a recent project which uses browsers history to show breadcrumb

Related

2sxc - dnn - News app v3.1.5 - Problem with filtering

Hello 2sxc News app experts,
hopefully you can help me with my 2sxc News app v3.1.5 (2sxc v10.25.2).
I am struggeling with following problem: On one page I inserted the News app. Created some categories (category1..3). After this I created some news items and chose one category for every news item.
After this I created a News module on another tab to show the newest 3 items of a dedicated category. I modified the ViewConfiguration (id of the previous module, tab of the previous module, "category1").
What I expected was to see all news items of "category1". But unfortunately I see all items. The filter did not work.
What I tried so far (with no success):
Recreation of categories (delete categories from news items, deletion of all Categories, creation of categories, adding one category to a news item).
Export and reimport of data (export all data to xml, deletion of all data, reimport of all data)
What I can see in query designer is, that the link from "ModuleDataSource" to "View Category" is showing 1 item (probably the category of the ViewConfiguration), but the result of RelationshipFilter after "View Category" to "StreamFallback" is showing 0 items. So the fallback comes in play and all items are showing.
From here I have no idea what to check or what to configure, to get the Category of the ViewConfiguration get working. Has anyone a hint or an idea?
Any help is appreciated. Thank you very much!
welcome to StackOverflow :)
So first of all - we just released a new News app V4 today! https://2sxc.org/en/apps/app/news-app-v4
It's a complete rework of the News so if you're just getting started - I would start there. My guess is whatever you need is already fixed ;)

Joomla URL parameters

I would like to get your opinions and solutions on how can I solve this problem.
I have a website that displays restaurants, events and attractions in multiple cities and countries.
Right now I implemented the following structure:
Country A
--City A-1
----Restaurants
----Events
----Attractions
--City A-2
----Restaurants
----Events
----Attractions
Country B
--City B-1
----Restaurants
----Events
----Attractions
--City B-2
----Restaurants
----Events
----Attractions
There is so much redundancy, specially when it comes to modules that display content from specific categories.
What I thought would be a good solution, is to only create categories for Restaurants, Events and attractions, and figure out a way to specify which country and city by adding parameters to the URLS.
I would appreciate any thoughts and suggestions.
Thank you
You can't avoid creating the full menu in the menu manager.
As for modules you could add a textfield inside the module with an array like: 1,7:2,8... = menu_id_1,content_of_city_7:menu_id_2,content_of_city_8...
You will have just one module for each type (restaurant, event, attraction) connected to all menus you want to be displayed and you will check the content of it matching the menu id from url with your array.

How to list most visited links in Drupal from different pages?

I have made one block for most visited links (Top Links) in my drupal website but I dont know how to list most visited from different pages. For example, if I have created a page named drupal and within that page i have added some content with some title, then i have to examine and count those titles and list the top visited title from each and every page on my homepage(only one from each and every title that is most visited) and list them on my homepage block.
Could anyone help me with this.
Thanks in advance!
Make sure the statistics module is enabled. Visit /admin/config/system/statistics (Drupal 7) and make sure Count content views is enabled (ticked).
Use views to create a block the usual way; for example add a field like Content: Title. Then make sure you add a sort criteria of Content statistics: Total views (desc).

Drupal 7 expanding fields

I have a field in a cms called 'services' the services is a lsit of checkboxes with the values
1|digital
2|web
3|print
4|apps
The issue is each of the options has a related url. Is there way to link a url to a 'service' or am I looking at taxonomy to solve this issue?
You need to use a taxonomy. A select list is simply a key/value pair with no other additional data. If you build a new taxonomy, you can either use the taxonomy URL for your purpose or you can add a Link field and give each term a specific URL and tie that in somehow, maybe through Views or a custom display.

Show list of users based on taxonomy term (D7)

I have a taxonomy vocabulary "Department". In the user account I have a taxonomy term reference field with this vocabulary. So each user can be assigned to one or more departments.
I used the module Taxonomy Meny to show the taxonomy terms in my main menu.
Now I want to show a list of users when I click on a department in the menu.
Does anybody have an idea how I could do this?
Thanks.
Note sure here, but I suppose you should be able to use the views module to achieve this. Use can show all user nodes (or a list by choosing fields) and enter the department as a contextual filter.
Uou can use views in 2 ways, to produce pages or blocks. Contextual filters are a bit easier with pages, but that might confilt with yout module.
I like this tutorial, it gives a clear insight in contextual filters. It should get you started.
http://www.metaltoad.com/blog/using-drupal-contextual-filters-views

Resources