help to better help you:

Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!

[SOLVED] Select single category by default

[SOLVED] Select single category by default

8 years 6 months ago - 8 years 6 months ago
#22133
In our installation, we are only using one category. Is there a way to make it selected by default - perhaps unchangeable? It causes confusion when adding an event if they have not already selected the category.

Just trying to eliminate that confusion.
Joomla 3.5.1
JEM 2.1.6 stable (with Customization)
PHP: 5.4.45
Last edit: 8 years 6 months ago by rstarkey.

Please Log in or Create an account to join the conversation.

Re: Select single category by default

8 years 6 months ago
#22139
We invested lots of time, energy, nerves and whatever to provide large category trees including multiple selection and now you want one little, lonely category!

O.k., because you want to become an expert I've a little crazy idea. B)

In components/com_jem/models/fields/catoptions.php find line 80
Code:
$selectedcats = $db->loadColumn();
Below this line insert following block:
Code:
// Special: if there is one category only and nothings selected, (pre-)select this one. if (empty($selectedcats) && (count($options) == 1) && !empty($options[0]->id)) { $selectedcats = $options[0]->id; }
This will automatically select a lonely category in the list. (also if there are more categories as long as the user is only permitted to see one)

I'm not sure if we will add this to our official releases so in worst case you need to add these lines each time you update JEM.

Attachments:

The following user(s) said Thank You: rstarkey

Please Log in or Create an account to join the conversation.

Re: Select single category by default

8 years 6 months ago
#22140
FANTASTIC!!!

I bet when the next version comes out, it's going to have a lot of awesome changes.
Joomla 3.5.1
JEM 2.1.6 stable (with Customization)
PHP: 5.4.45

Please Log in or Create an account to join the conversation.

Time to create page: 0.544 seconds