I want to set up a review option. So we have a product and a review.

Is it possible to use tokens from the node reference in the url alias? So for example my product is.
url.com/product/[term]/[produc_title]

Is there a way to have my reviews path as:
url/com/product/[node_reference_term]/[node_reference_title]/reviews/[review_nid]

Maybe there's a work around for this?

Comments

Michsk’s picture

Seems this is being discused in : http://drupal.org/node/483156

Michsk’s picture

Status: Active » Fixed

enough ways to do this. Trying custom tokem module a.t.m.

Michsk’s picture

So this was pretty easie.

I basically want to get the path of the parent node and place /review/[reviewnid] behind it, so using custom tokens module and using the following made me do just that.

$result = '';
if(!empty($data['node']->field_tel_review['und'][0]['nid'])){
  $result = drupal_lookup_path('alias', 'node/'.$data['node']->field_tel_review['und'][0]['nid']);
}
return $result;

And that gets me the alias of the referred node so i still have the freedom to play with the rest of the pattern.

Anonymous’s picture

Thanks Iasac, I was looking for a solution and your answer worked! :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.