Drupal Paths destination - drupal

How can I change destination paths in Drupal? For example, instead of having http://localhost/cuba/user?destination=node/25/add-review, I want http://localhost/gameswapuk/user?destination=content/(name of the node)/add-review.
What I mean is replacing node/25 for the name or title of the node automatically.

Hi use pathauto module.
Module automatically generates URL/path aliases for various kinds of content (nodes, taxonomy terms, users) without requiring the user to manually specify the path alias.

Related

how to fetch old RSS feeds from movabletype site?

Is there any instructor for that? I mean some way to access other pages of movabletype feed?
Example:
MovableTypeSite/feed/page=10
or
MovableTypeSite/feed/rss?page=7
Assuming you are using the default static publishing scheme of Movable Type, your feeds are static files that cannot be modified through URL parameters. The feeds by default contain the last 15 entries, but you could increase this number by modifying the default "Feed - Recent Entries" template of the blog in question.
You could change <mt:Entries lastn="15"> to <mt:Entries lastn="60"> or <mt:Entries days="60"> or use any of the attributes of the Entries tag to customize your output.
It would also be possible to set up "paginated" feeds, such as a per month feed. You could start with the default feed index template referenced above and copy it into a new archive template of the type "Entry Listing".
A little-known feature of Movable Type's search is that it supports multiple templates and by default includes a feed template. In the search results URL, you can specify a page=2 argument (or whatever page). Of course, the trick is that you need a search term -- which may or may not work well for your use.
The URL: [MT Home]/mt-search.cgi?limit=20&Template=feed&search=test&page=2
Use in the template generating the feed (a number superior to the number of entries in the system), publish it, and voilà.

How to change url_alias partially according to a pattern Drupal

How to change url_alias partially according to a pattern?
We have site with reports to users.
We continue to update the reports with new content node but the url_alias kept same.
For example,
/report/report_a
/report/report_a/subreport_1
/report/report_b
…...
Users bookmark the pages. So they can get into the reports directly.
Recently we change the path pattern with /docs/ in front:
/docs/report/report_a
/docs/report/report_a/subreport_1
/docs/report/report_b
…...
Now the new content nodes go to these url_alias.
But the users have booked mark the pages.
So we want to make them previous book marks, url_alias, can be redirected into the new path.
For example,
/report/report_a to be redirected into /docs/report/report_a
/report/report_a/subreport_1 to be redirected into
/docs/report/report_a/subreport_1
That means to make /report/* paths to be redirectly to /docs/report/* paths
Here * is wildcard.
Do the old report pages still exist? You could add a bit of javascript to each page that redirects to the new location...
Can you create aliases for the old nodes? If there are a lot, it probably wouldn't be too hard to run a script that takes all the old paths and creates aliases for them.
In D7, URL Aliases are under Config | Search and metadata
It's probably easiest add a redirect to your .htaccess file. Something like this should work for your example:
Redirect /report/ /docs/report/

Drupal pathauto usage

I have a node called artists. It has a field called shortname. I want to have it so that when I add an artists with shortname = 'foo' you can navigate to http://bar.com/foo/ and it will show that artist's node.
What's the magic configuration in pathauto to make this happen?
You need The path auto which requires the token module. You'll need to set up your path using the [title-raw] token. Which should be used with care as node titles could inject bad stuff into your URLs.
It's not a good idea to have http://example.com/[title-raw]. You'll end up with possible name collisions. Try http://example.com/artist/[title-raw]

Drupal 6 Views 2 using Node Path as an argument

Please consider helping a Drupal noob who is in danger of tearing out what hair I have remaining.
I have a view that I want to add an argument to so that it only displays the details of the specified product. Since I'm using URL aliasing the argument is in the form of shop/product1, shop/product2 etc. However, when I go to add an argument node path (which is what I have set to shop/product1 etc is not listed) the only I could use is Node: Nid but that doesn't work because my argument is not a node id but a path alias.
The workaround I've been using is to create a CCK field to store my node path and then create an argument using the CCK field. Is this the only option?
Regards,
Sean
One way to do this would be to create a custom module and define your own callback which would then work out the NID from the path and pass that as an argument to the view using views_embed_view.
There are some contrib modules which allow you to filter by PHP code which would probably do as well.
I believe you can still use NID as the argument, as that is what's in the actual path even though you are displaying an alias in the address bar.

Drupal Views (Page) Using Human-Friendly Path

I have CCK and Views module installed. For the sake of this question scope, I'll call the content type as Project. Projects have many Members.
Project nodes are accessible through /project/project-name. I want to be able to display list of members through path /project/project-name/members.
Is there any way to do this?
Currently I have a views setup for page display on path /project/%/members, and have the argument taken from the url. I realize I can't use "Node ID from URL" option directly since it's node name instead of node id. Therefore I tried to enable "PHP Code" argument. But the problem is, Drupal Views always assume that the parameter is "project-name" and therefore ignored my php code argument setting. Anyone knows how I might be able to do this?
Thanks
Yes, you can actually use the "Node ID from URL" option, and you should.
Use the path or pathauto module to generate human-readable URLs for your projects in the form project/project-name. This will create a human-readable alias for the node, but the underlying Drupal system path is still node/nid.
Views can still use the "Node ID from URL" as an argument (or Contextual filter, as they are known in Drupal 7) even with human-readable aliases for those ugly paths.
If the project's name is the node title you can get what you want pretty easily.
You can pass the node title as argument instead of the nid, but the result will be the same. You get some options to use lowercase, transform - to space ect, as what you can do in a url is limited compared to a node title.
The rest of the view would be the same, as the solution using node nids in the url.
You need to create path aliases for /project/project-NID/members to /project/project-Name/members
I asked this exact question a month ago. :)
drupal link to view dependent on argument

Resources