Wednesday, December 7, 2011

Jomsocial creating a new group - pre-select the proper category

When we create a new group in Jomsocial, we have to select category from drop-down. Jomsocial shows the list of categories you have created from back-end in accending order of category names. What if you want to change a default value, don't look at administrator site there is no option. So for that you need to just override groups.forms.php file from template folder & add this code at the end. The value will be changed according to what should set as a default value from the options(just inspect element n find value).
<script>
joms.jQuery("#categoryid option[value='1']").attr("selected", "selected");
</script>
e.g if have Automotive, Business, General, Internet, Music as categories Jomsocial displays Automative now it shows General as default. That is what i wanted.
When creating a new group, it should pre-select the proper category.

No comments:

Post a Comment