V
V
Vladimir2015-03-23 16:05:51
Drupal
Vladimir, 2015-03-23 16:05:51

Drupal 7! How to create dynamic urls?

Hello!
Tell me how you can make a dynamic url for materials that belong to several terms? There is a page, the path of which is created according to such a template ( tags/[node:field-teg]/[node:title].html ), of course, if I go to any term to which this page refers, the path of this page does not change!
Let's say there are two terms.

  • term1
  • term2

There is a created page of any type of material with url ( pageone.html ) and it refers to these two terms, you need to do this when you go to term1 url looks like this ( mysite.ru/term1/pageone.html ) if I go to term2 ( mysite. py/term2/pageone.html ) i.e. only the term in the path changes.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Timofey, 2015-03-23
@mr_T

You just don't have to do it. One resource = one URL. You can only pass tid through the GET parameter if something changes on the target page depending on it. And this is easily done in the node template, since you have access to the parameters through the args function and access to all the fields of the node through $content['field_name']['#items']. If you are using views, then just print unformatted list, renerred entity.

A
Alexander, 2015-03-23
@NeiroNx

The Views module solves such problems.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question