开发者

Drupal 6: Link to View changed to point to Node if View only contains 1 Node

On my website, I have a big red "Special Offers" button that currently links to my special-offers View, which just lists teasers for all of our current offers. At present we only have 1 offer, and so it would be better if this link took you straight to it.

I guess the best way would be to do some preprocessing and change the link before it gets displayed on the page, but I'm not sure of the best way to do this. I could just use an SQL count query to set a variable in theme_preprocess_page(), which I then check in page.tpl.php, but is there a nea开发者_Go百科ter / more efficient / correct way to do this?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜