Jump to content

Start New Topic


Noble~

Recommended Posts

Good Evening,

Is there a way to change the link when the start new topic is clicked just in once specific forum?  when the user clicks the button i would like to redirect them to another item.

I know i can redirect the forum but I'm looking to do something else.

Thanks

Link to comment
Share on other sites

The following should change the URL when viewing a forum's index, and when viewing a topic...

Note:

  • X = the ID of the forum where you want something different to be done with the button
  • https://the.different.url/ = the different URL

Template: forums -> front -> forums -> forumButtons

Replace:

<a class="ipsButton ipsButton_medium ipsButton_important ipsButton_fullWidth" href="{$forum->url()->setQueryString( 'do', 'add' )}" title='{lang="start_new_topic_desc"}'>{lang="start_new_topic"}</a>

With:

{{if $forum->id === X}}
    <a class="ipsButton ipsButton_medium ipsButton_important ipsButton_fullWidth" href="https://the.different.url/" title='{lang="start_new_topic_desc"}'>{lang="start_new_topic"}</a>
{{else}}
    <a class="ipsButton ipsButton_medium ipsButton_important ipsButton_fullWidth" href="{$forum->url()->setQueryString( 'do', 'add' )}" title='{lang="start_new_topic_desc"}'>{lang="start_new_topic"}</a>
{{endif}}

X = the ID of the forum where you want something different to be done with the button

Template: forums -> front -> topics -> topic

Replace:

<a href="{$topic->container()->url()->setQueryString( 'do', 'add' )}" class='ipsButton ipsButton_link ipsButton_medium ipsButton_fullWidth' title='{lang="start_new_topic_desc"}'>{lang="start_new_topic"}</a>

With:

{{if $topic->container()->id === X}}
    <a class="ipsButton ipsButton_medium ipsButton_important ipsButton_fullWidth" href="https://the.different.url/" title='{lang="start_new_topic_desc"}'>{lang="start_new_topic"}</a>
{{else}}
    <a class="ipsButton ipsButton_medium ipsButton_important ipsButton_fullWidth" href="{$forum->url()->setQueryString( 'do', 'add' )}" title='{lang="start_new_topic_desc"}'>{lang="start_new_topic"}</a>
{{endif}}

 

Note: changing the 'Start new topic' action on the site index would required a plugin to intercept the chosen forum ID and redirect to your chosen URL.

Edited by Nathan Explosion
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...