SimonV
Well-known member
I have an option that I want to use the output in a template condition, the option is a PHP Callback - Array as seen below:
using this code that I found somewhere here on the forums:
Up to this point I'm fine, I have the option as I need it but now I'm stuck in how to utilise this with a template conditional as the output.
Im looking for a simple way to include user groups in a template condition that are set in an addon's options so if there are better ways to do this please do advise me as Im a total newbie when it comes to XenForo addon creation.
EDIT: Actually it might be better to just not include my js file for certain usergroups, I have the file included using addRequiredExternal in my addon Listener file.
using this code that I found somewhere here on the forums:
PHP:
<?php
class AddToHomeSceen_Options_UserGroupChooser extends XenForo_Option_UserGroupChooser
{
public static function renderCheckbox(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
return self::_render('option_list_option_checkbox', $view, $fieldPrefix, $preparedOption, $canEdit);
}
}
Up to this point I'm fine, I have the option as I need it but now I'm stuck in how to utilise this with a template conditional as the output.
Im looking for a simple way to include user groups in a template condition that are set in an addon's options so if there are better ways to do this please do advise me as Im a total newbie when it comes to XenForo addon creation.
EDIT: Actually it might be better to just not include my js file for certain usergroups, I have the file included using addRequiredExternal in my addon Listener file.
Last edited: