[support] Rewriting Views URLs

sebastian inforazor at gmail.com
Wed Dec 1 18:21:38 UTC 2010


The path order has a reason, remember that everything is really:

index.php? with parameters then added to the back of the URL for the 
page call and variables.

So first it is the page, then it is the variables you are sending it.

If you want, you can use path-auto for your "hundreds of URLs" to set 
these for you. And instead if you detect on the node level that you have 
a variable named "/view" you call up a View and pass it the context of 
your current node ID.

This would involve opening node.tpl.php and adding a line of code to 
load the View block/page and passing it the $node->nid for your current 
page upon display.

There are lots of otherways to do this, as Drupal really does offer 
multiple-paths to success, but this is the first idea that comes to mind 
for how to flip the path around!

Good luck!

On 2010-11-24 7:10 AM, DTH wrote:
> I tried that, but got
>
> "%" may not be used for the first segment of a path.
>
> as the error.
>
> --DTH
>
> On Wed, Nov 24, 2010 at 2:24 PM, Shyamala<shyamala at netlinkindia.com>  wrote:
>> You can do this in the path settings itself by using  %1/%2/view as the path
>> right?
>>
>> ________________________________
>> Quoting DTH<david at hartster.org>:
>>
>> I have a view that takes the forms:
>>
>> view/foo/bar - all nodes with category foo and subcategory bar
>> view/baz - all nodes with category baz etc
>>
>> However, I'd like the view to exist at
>>
>> foo/bar/view
>> baz/view etc
>>
>> Assuming there's hundreds of urls, so creating url aliases for each
>> one is out, is the only way to do this via htaccess and rewriting
>> view/[a-z]/[a-z] or is there a more Drupally/easier way?
>> --
>> [ Drupal support list | http://lists.drupal.org/ ]
>>
>>
>>


More information about the support mailing list