Enforcing Single category selection only
Posted: Wed Oct 25, 2006 9:55 am
Hi,
By default we can select multiple categories for an entry.
but now i want to enforce only single category selection per entry.
for this i have just commented the (+) sign in functions_entries_admin.inc.php file. the line i have commented is 157 line. <a style="border:0; text-decoration: none" href="#" onclick="showItem('categoryselector'); return false" title="<?php echo TOGGLE_OPTION; ?>"><img src="<?php echo serendipity_getTemplateFile('img/plus.png') ?>" id="option_categoryselector" style="border: 20px" alt="" border="0" /></a>.
Also i have commented document.getElementById('option_' + id).src = '<?php echo serendipity_getTemplateFile('img/plus.png') ?>'; in line numbers 236 and 278 in showitem(id) function because i was getting javascript errors.
Now its working fine. now for categories combo box is shown and only one category can be selected.(+) sign is not shown now before the combo box.
Is this correct way of doing this task? will it give problems else where?
is there any better solution for this?
Thanks.
manoj.
By default we can select multiple categories for an entry.
but now i want to enforce only single category selection per entry.
for this i have just commented the (+) sign in functions_entries_admin.inc.php file. the line i have commented is 157 line. <a style="border:0; text-decoration: none" href="#" onclick="showItem('categoryselector'); return false" title="<?php echo TOGGLE_OPTION; ?>"><img src="<?php echo serendipity_getTemplateFile('img/plus.png') ?>" id="option_categoryselector" style="border: 20px" alt="" border="0" /></a>.
Also i have commented document.getElementById('option_' + id).src = '<?php echo serendipity_getTemplateFile('img/plus.png') ?>'; in line numbers 236 and 278 in showitem(id) function because i was getting javascript errors.
Now its working fine. now for categories combo box is shown and only one category can be selected.(+) sign is not shown now before the combo box.
Is this correct way of doing this task? will it give problems else where?
is there any better solution for this?
Thanks.
manoj.