0

I've created contents using custom form. I don't use content types. I could add, update and delete that content by access test, test/id/edit and test/id/delete.

I've displayed content lists for a user by tests/uid. Now I want to use user name instead of uid. I have to replace space by '-' and also replace all special characters. So my choice is both url alias and path auto.

But I couldn't add custom url pattern into pathauto pattern. There is only available for content types, taxonomy term, user and file path. But I want to custom url pattern for custom content inside the user path.

1 Answer 1

1

If I understand your question correctly, you're wanting to implement Pathauto's API. Here's a tutorial on how to do so. Basically, you need to implement hook_pathauto() and make use of pathauto_create_alias() & path_delete() when you're performing your Create/Update/Delete operations. It looks like you can use the token_type of user for your token replacement.

4
  • I need to add path alias for all users and add, update, delete a user
    – Guru
    Commented Aug 19, 2015 at 6:47
  • See the tutorial link for bulk adding/updating. You'll also need to implement user hook functions if you're wanting to take action on path aliases during user creation, updating, & deletion.
    – Shawn Conn
    Commented Aug 19, 2015 at 7:02
  • Thank you very much. It is working fine. Very nice tutorials.
    – Guru
    Commented Aug 19, 2015 at 7:49
  • Is it possible to use more than one pattern.
    – Guru
    Commented Sep 29, 2015 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.