Hi, Dimas, thank you very much for your quick response. I am trying to add more function in the event function.
I have modified the events.forms.php, and make it load different events.forms based on the uri address through
$currenturi = $_SERVER["REQUEST_URI"];
$currentlasturi = basename($currenturi);
switch($currentlasturi){
case "wedding": //Form Page
include("/components/com_community/templates/jomsocial/layouts/events.formswedding.php");
break;
case "announce-wedding": //Form Page
include("/components/com_community/templates/jomsocial/layouts/events.formswedding.php");
case "birthdayparty": //Form Page
include("/components/com_community/templates/jomsocial/layouts/events.formsbirthdayparty.php");
.......
Now I am trying to set the event catid in the events.formswedding.php, events.formsbirthdayparty.php directly...... which can pass the validation of
if(!$event->catid){
$validated = false;
$mainframe->enqueueMessage(JText::_('COM_COMMUNITY_SELECT_CATEGORY'), 'error');
}
in localhost/components/com_community/controllers/events.php (line 2190- 2193)
My question is: is there a simple way to set the event catid in the code of
<div class="joms-form__group">
<span><?php echo JText::_('COM_COMMUNITY_EVENTS_CATEGORY'); ?> <span class="joms-required">*</span></span>
<?php echo $lists; ?>
</div>
? If I can set the event category id directly and pass the form validation, I will hide the "select category" part in the form. I have googled 3 days to solve this problem and tried various ways. But I failed. You are a specialist. I think you can help me. Thank you.