Drupal块PHP
我用下面的代码创建了一个自定义块,但我在将组标题转换为链接时遇到了一些问题,该链接会随时将用户带回组 下面是我使用的代码,我想active会把它变成一个链接,但也许我很愚蠢Drupal块PHP,php,drupal,Php,Drupal,我用下面的代码创建了一个自定义块,但我在将组标题转换为链接时遇到了一些问题,该链接会随时将用户带回组 下面是我使用的代码,我想active会把它变成一个链接,但也许我很愚蠢 <div class="active"><h2><?php print $group_title; ?></h2></div> 以下是完整代码: <?php $group_title = og_get_group_context()->titl
<div class="active"><h2><?php print $group_title; ?></h2></div>
以下是完整代码:
<?php $group_title = og_get_group_context()->title; ?>
<?php $group_nid = og_get_group_context()->nid; ?>
<?php $forum_link = og_forum_get_forum_container($group_nid); ?>
<div class="active"><h2><?php print $group_title; ?></h2></div>
<div class="content"
<div class="item-list">
<ul>
<li class="user-input-link"><a title="Add a new Forum topic"href="/node/add/forum?gids[]=<?php print $group_nid; ?>">Add a new forum topic</a>
</ul>
</div>
</div>
您需要执行锚定标记,如:
<div><h2><a href="url_goes_here"><?php print $group_title; ?></a></h2></div>
我不知道如何在Drupal中获取url。您需要创建url才能使其工作
以下是指向API的链接,其中包含更多信息:
<div class="active"><h2><?php print l($group_title, "node/{$group_nid}"); ?></h2></div>