emanuele likes!
Since in 1.1 we have a Theme class (actually two lol), it may be an option to have the array as attribute of the class and then have in $context just "no_index" = true/false
Something like:
protected $no_index_actions = array();
public function __construct()
{
...
$this->no_index_actions = array('profile', 'search', 'calendar', 'memberlist', 'help', 'who', 'stats', 'login', 'reminder', 'register', 'verificationcode', 'contact');
...
}
then:
public function setupThemeContext()
{
...
$context['robot_no_index'] = in_array($context['current_action'], $this->no_index_actions);
...
}
and finally in the template:
// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />';
This would still allow the theme to define additional no_indexes like:
public function __construct()
{
parent::__construct();
$this->no_index_actions[] = 'my_action';
}
Well, not a lot of advantages in the end, just one less index in context. xD
BTW I like the idea. nods