Posted by attar_eweev on November 19, 2012 at 4:05pm
I have two sections in my site (male , female).
I want to achieve the following:
When i click on section male(a link to the male section) the current page reloads with "male" as arg(0) for example(http://mysite.com/node/1=>http://mysite.com/male/node/1)
and i want the new url(http://mysite.com/male/node/1) to load the node page (has nid equal 1) with "male" as a query string argument for somes conditionnal content to show.
Can anyone help me please ?
Comments
same issue, my work-around
The url of nested (sub) pages does not include higher level pages by default. I don't know if this is the best way as I'm a drupal intermediate, but what I had to do on one of my sites, an ecommerce type site, was to create the URL path setting so that it listed the heirarchy. So my page for "Aerobic_Band" would by default have the url www.sitename.com/Aerobic_Band. But Aerobic Band is a sub page of the Products page. I wanted the url to be www.sitename.com/Products/Aerobic_Band. At the bottom of the page cms interface there is a tab for URL path settings. You would have to give your page the URL alias of /male/node/1 or /male/shoes, whatever. Don't forget the / before male.
By doing this you can also manage blocks easier too. If you have a block (or menu) that should appear on many sub pages, you go to the interface for that block and at the bottom "Pages" tab, select "only the listed pages". In my case I listed the page Products/* This makes the block appear on all pages that are sub pages of Products. In your case, male/*
Hope this helps!
lori erickson
Thank lorierickson1 for your
Thank lorierickson1 for your help
I found the correct way,by using these hooks:
hook_url_outbound_alter(&$path, &$options, $original_path),
hook_url_inbound_alter(&$path, $original_path, $path_language)