如何为drupal中每个用户角色的profile2的登录/注册页面创建自定义模板文件

时间:2016-08-17 04:47:31

标签: drupal drupal-7 drupal-theming

我正在建立职位空缺网站,它有两个角色,用户和雇主。我使用profile2并为两个角色都有唯一的注册路径。我已经为用户制作了自定义login/register页面并且进展顺利。 我也想为雇主制作自定义login/register页。 我已经尝试制作page--employer.tpl.php但它没有用。

以下是用户page--user.tpl.php {/ 1}}中的代码:

login/register

1 个答案:

答案 0 :(得分:0)

您可以实现(在您的template.php中)template_preprocess_page($variables)并通过$vars['theme_hook_suggestions']数组添加您自己的模板文件名建议。

您可以使用current_path()drupal_get_path_alias()

检查当前路径(在if语句中以了解何时添加建议)

查看template_preprocess_page的API。

另请查看this stack question