Joomla URL parameters - url-routing

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.

Related

Automation script for website in loop

Below is the screenshot of the web pages, I need to write a script that add the product automatically, suppose 15 times.
I achieved this for one single entry but i need to write it in a loop.
Challenge here is that i need to select different categories based on which there are different sub-categories and based on sub-categories there are different sub-sub-category so can anyone suggest how to achieve this.
If the fields and dropdown itself don't change you can create some kind of collection for each of the category options and sub options. Then with some mapping from one category to other you can achieve this.
Eg. CategoryArray will have [Item1, Item2, Item2] selection of this choice will guide which subcategory array you will access like Item1SubCategoryArray then so on and so forth.

Get content Id (nid) from path on views block

I just can't seem to wrap my head around Drupal relationships. I have been reading and watching tutorials, but as soon as I try to get my own project done - I fail. I think it's very basic, so I would love to understand it. Maybe someone here can help me understand how it works :)
On my drupal site, I want to keep track of some private game tournaments.
I have created a content type called contestant, which has fields like: Tournament date, Player name, Final Position. I can then create a view that list the information from one tournament. I used the help I got from this thread: drupal views dynamic filter
I would like to have the view described above as a block. And then place that block-view on a "tournament description" page. I could do this, by simply creating a new block each time, and then manually place it on the page it should be shown (structure-->Blocks-->configure), but that is not an elegant way to do it. I am pretty sure this is where Relationships should be used. But I fail to understand how to create this relationship, so that the specific block view, that matches the specific tournament description page will be displayed together.
Use a Content:Nid as a Contextual filter.
WHEN the Filter value is not in the URL >>
Provide default value
Content ID from URL

How to know the link clicked by the user to set the breadcrumb using views in 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

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

Create views from field values Drupal-7

So if I understand correctly I have will a few content types "Category", "Sub Category", "Product", "Images" I am just not sure how I will associate the content types with each other to build views. So based on my structure below: I would create a Category name "Home" with the "Category" type. The category would have a view that shows all Sub Categories that are associated with this view "Category". This is my question: When I go to create my new Sub Category "Furniture" how do I associate it with the view that is on my "Home" Category page? And so on with the Products which will all belong to sub category and the images will all belong to a product. Can I use a custom field that the user adds a string?
Home (category)
-Furniture (sub category)
-Sofa(product)
-images
-Lamp(product)
-images
Outdoors(category)
-Deck Furniture(sub category)
-Table(product)
-images
-Fire-pit(product)
-images
I am sure this was confusing so if anyone has questions please ask. Any help would be amazing. Thanks in advance.
Your question is a little confusing because it seems that there are two parts to it that aren't clearly defined.
If you're looking to relate content to each other, check out the References module.
As for creating the display you're looking for, the Views module is likely what you're looking for. There is also a Views Hierarchy module which you may need but is currently unavailable for Drupal 7.

Resources