Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Noble~ Posted December 11, 2020 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
bfarber Posted December 14, 2020 Posted December 14, 2020 By editing the template you could use a conditional to redirect the button manually.
Nathan Explosion Posted December 14, 2020 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
Recommended Posts