View Categories

Using Shortcode Parameters

While the forum typically works automatically based on URL routing, you can use shortcode parameters for more advanced placements, such as embedding a specific forum or topic on a landing page.

1. Finding IDs in the Dashboard #

To make it easy to use these shortcode parameters, the plugin provides the required IDs and ready-to-use shortcodes directly in the administrative interface:

  • Boards and Forums: Navigate to the Boards or Forums tabs. You will see an ID column for each entry. In the Forums list, a Shortcode column provides a clickable shortcode that you can copy to your clipboard.
  • Topics: In the Forums tab, click the Topics link for any forum. This will display a list of the most recent topics, their IDs, and a ready-to-use [gofrm_topic] shortcode for each.

2. Parameters for [gofrm_forum] #

The [gofrm_forum] shortcode can be used to display a specific forum’s topic list anywhere on your site.

Attributes: #

  • slug: The URL slug of the forum you want to display.
  • id: The internal ID of the forum (alternative to slug).

Note on Slugs: Forum slugs must be unique across the entire site. If you attempt to create a forum with a slug that already exists (even in a different board), the plugin will automatically append a numeric suffix (e.g., general-1) to ensure uniqueness. Slugs are also automatically sanitized to be URL-friendly, stripping out invalid characters like *, #, and spaces.

Examples: #

Display a forum by its slug: [gofrm_forum slug="general-discussion"]

Display a forum by its ID: [gofrm_forum id="5"]

2. Parameters for [gofrm_topic] #

The [gofrm_topic] shortcode allows you to embed a specific topic and its replies directly on any page.

Attributes: #

  • id: The ID of the topic (this is the Gravity Forms Entry ID).

Example: #

[gofrm_topic id="123"]

3. URL-Based Parameters #

The plugin uses URL parameters to navigate between views, especially in “Shortcode Mode” (rewrites disabled).

Common URL Parameters: #

  • gofrm_forum: Used to navigate to a specific forum.
    • Example: yoursite.com/community/?gofrm_forum=announcements
  • gofrm_topic: Used to navigate to a specific topic.
    • Example: yoursite.com/community/?gofrm_topic=456
  • gofrm_tag: Filters the topic list by a specific tag.
    • Example: yoursite.com/community/?gofrm_forum=general&gofrm_tag=question
  • gofrm_profile: Navigates to the user’s profile page.
    • Values: 1.
    • Example: yoursite.com/community/?gofrm_profile=1

4. Priority Logic #

GravityOps Forum uses a smart hierarchy to determine what content each shortcode should render:

  1. Shortcode Attribute: If id="123" is in the shortcode, it will always show that specific forum/topic, regardless of what is in the URL.
  2. URL Parameter: If no attribute is provided, the shortcode looks for ?gofrm_forum= or ?gofrm_topic= in the URL.
  3. Dedicated Page Context: If the shortcode is on its own dedicated page (manually mapped or auto-discovered), it will attempt to render relevant content.
    • [gofrm_profile] will automatically show the current user’s profile.
    • [gofrm_forum] or [gofrm_topic] will provide a helpful link back to the index if no specific item is selected.
  4. Fallback: If neither is present, the shortcode renders nothing (or a helpful message if on a dedicated page).

This allowing for both static “locked” shortcodes and dynamic, navigation-aware portals.