문제

I am creating a custom block programatically, there i need to display a node title and link to it, I have accomplished the displaying of node and title.

How do i link the node to its alias, each node in my application has an alias.

How do i access the alias ion my code. Thanks.

도움이 되었습니까?

해결책

You can use function:

drupal_lookup_path('alias',"node/" . $node->nid);

to get your node URL alias by node id.

Then just create the link with l -function.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top