Jump to content

Recommended Posts

Posted

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

Posted (edited)

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
  • Recently Browsing   0 members

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