Noble~ Posted December 11, 2020 Share Posted December 11, 2020 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 More sharing options...
Noble~ Posted December 13, 2020 Author Share Posted December 13, 2020 I guess this cant be done? Link to comment Share on other sites More sharing options...
bfarber Posted December 14, 2020 Share Posted December 14, 2020 By editing the template you could use a conditional to redirect the button manually. Link to comment Share on other sites More sharing options...
Nathan Explosion Posted December 14, 2020 Share Posted December 14, 2020 (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 December 14, 2020 by Nathan Explosion Noble~ and Meddysong 2 Link to comment Share on other sites More sharing options...
Noble~ Posted December 14, 2020 Author Share Posted December 14, 2020 Great Thanks Nathan 👍 Link to comment Share on other sites More sharing options...
Recommended Posts