Simple:Press Documentation

Template Tag: Topic Link

The Template Tag Topic Link displays a link to a specific forum topic if current user has access privilege. The output displayed will use your theme styling.

This template tag is included in the Template Tags and Widgets plugin available on the Simple:Press Our Plugin Library page.

The function used is sp_TopicLinkTag() and the file that makes the magic happen is sp-TopicLink-tag.php which is located in the plugin’s template-tags/library folder.

You can pass optional arguments to the function for formatting and display but the TopicID number is required. If topic ID number is not found it will display “Topic not Found”.

Options

  • topicId – ID of the topic the link goes to. This is the topic number and is required.
  • linkText – textual content of link. This is entered as text. The default is the topic name.
  • beforeLink – Text that is shown before the link. The default is to show none.
  • afterLink – Text that is shown after the link. The default is to show none.
  • listTags – Wrap the link in li tags. This would be true or false. The default is false
  • echo is a true/false expression using 1 as true and 0 as false. The default is true.

Usage

An example of using this tag with a Topic ID number of 1o would be.

<?php sp_TopicLinkTag('topicId=10'); ?>

An example of using this tag with a Topic ID number of 10 and showing text before and after the link would be.

<?php sp_topicLinkTag('topicId=10&beforeLink=Go to&afterLink=now!'); ?>

You can also call this function by using a shortcode on pages, posts or widgets.

[sp_topic_link topicid='10']

The Using Plugins page describes how you obtain and install the Template Tags plugin. Once installed you would activate it from the Simple:Press administration page Available “Plugins – Install Simple:Press Plugins”

More Topics In SimplePress: Plugins


Copyright © 2006-2019 Simple:Press. All Rights Reserved.