Hi,

How can I rewrite the profile Edit links.

For example: I created a new category like "General Information about youself" and some fields, like "Name", "Age" etc. in this category.

Now, when a user likes to edit this infos, the link for editing is "http://mysite.com/user/edit/General Information about Yourself".

Can I rewrite this link to "/general-information", because I think, this kind of "wrong" links could lead to trouble somewhere.

So far it works, but it isn´t really right this way.

Is this normal? Did anyone made it to get "correct" links out of this messy link?

Of course I could name this category "general-information.html", but this name would also appear in the title of the Fieldset, which is a bit annoying.

I already put out every profile information by hand and not by calling $profile, so I can set at least the headings of the Categories by myself, but I can´t do anything about the Fieldset on the edit page for each category.

thanks for any help,
Marc

Comments

vm’s picture

investigate the url_alter.module which may help. Though I tend to keep my tabs short and have never run into this issue and thus never tested the aforementioned module for this use case.. ex: I'd just use General.

vertazzar’s picture

Yea... improvise :D

You can make, "general" and than you can use page-user-edit-general.tpl.php to override the $title and whatever else.

btw, VM can you tell me, is it good using tpl.php files to theme pages... Do those files have impact on site performance ?

vm’s picture

There is always some impact reagrdless of method. you can easily wind up in tpl.php hell or in template.php hell depending on what kinds of alterations and how extensive thery are. Depending on what needs to be done tpl.php files may be the easiest way to do it or the only way. An example:

Drupal pours everything into a single variable and prints it in the tpl.php file but what if you want to alter the order of things, or move fields around and such. At that point I think your only alternative is to handle it at the theme layer

vertazzar’s picture

switching order of $variableofblocks can do much damage?

Also, making some if $something: Hey you're not logged in or whatsoever else: Yea hi blah blah blah endif; statements could do hell ?

Thanks for the reply.

vm’s picture

What is meant by tpl.php hell is having TOO MANY tpl.php files. It's of benefit to try and plan ahead so that you don't wind up with a bunch of tpl.php files which are only changing minimal things when it can be accomplished with a single change in a singe tpl.php file.

Based on your examples and depending on what you want to do conditional php may be the only way to go which is what you have there. ie: show this to some users, show this to other users.

vertazzar’s picture

aha, thank you.