Hiding the Solspace Tag Tab for certain Weblogs in ExpressionEngine
Jul 15. 08The Solspace Tag Module is a fantastic addition to ExpressionEngine but it lacks the option to ‘disable’ tags for certain weblogs (sections). Not to fear, your friend the PHP if statement is here. In ‘ext.tag.php’ at around about line 262 there is a code block called ‘Add tag tab to tab array’. Just modify those two lines as per the example below:
$weblogs = array(3,4,9,10,11); if (!in_array($weblog_id, $weblogs)) { $LANG->fetch_language_file('tag'); $publish_tabs['tag'] = $LANG->line('tags'); }
Obviously the ‘weblogs’ array is an array of weblog id’s that you do not want the ‘tag tab’ to be displayed for. You could do this round the other way, writing an array of weblogs that should include the tag tab but I felt this was the better option in my scenario.