Simple:Press Documentation

Template Tag: Add New Topic Link

The  Template Tag Add New Topic Link creates a link for a user to go directly to a designated forum and to an already opened Add Topic form.

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_AddNewTopicLinkTag() and the file that makes the magic happen is sp-AddNewTopicLink-tag.php

You can pass optional arguments to the function for formatting and display but the forum ID number is required.

Options

The options available are tagID, tagClass,linkText, beforeLink, afterLink, echo and forumID.

  • tagId is a  unique id to use for div or list. The format is text with a default of spAddNewTopicLinkTag.
  • tagClass is the class to be applied for styling . The format is text with a default of spLinkTag
  • forumId is required and would be the ID number of the Forum where the topic is to be posted.
  • linkText is the  textual content of link typically the Forum Name.
  • beforeLink is text that is shown before link text. The default text is ‘Add new topic in the ‘
  • afterLink is text that is shown after link text. The default  text is ‘ forum’.
  • 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 forum ID number of 1 would be.

<?php sp_AddNewTopicLinkTag('forumId=1'); ?>

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

[sp_add_topic_link forumid='1']

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.