Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在以编程方式创建一个自定义块,我需要显示一个节点标题并链接到它,我已经完成了节点和标题的显示。
如何将节点链接到其别名,我的应用程序中的每个节点都有一个别名。
我如何访问我的代码的别名。谢谢。
您可以使用功能:
drupal_lookup_path('alias',"node/" . $node->nid);
通过节点 ID 获取您的节点 URL 别名。
然后只需使用l-function 创建链接。
l