Template Override on Edit Event View

  • LAC Webadmin
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 3 months ago #148808 by LAC Webadmin
Template Override on Edit Event View was created by LAC Webadmin
Hi Tuan,

Do you have any handy parameter for edit event fields  where I can hide and show fields depending on what is selected? Just like "shownon" in Joomla custom fields? 

I am overriding the Edit Event view and I'm trying to group all related fields into a tab and fieldset so it doesn't confuse our Event Creators. The current edit has fields all over whatever tabs and me as a developer gets confused where did I set things, moreover our event creators.

For example: if Price field has value entered it will show all related fields needed for registration. Maybe you already have a javascript created that I can just trigger by adding an element class selector or id.

Thanks,

Jackson

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

More
3 years 3 months ago #148809 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Template Override on Edit Event View
Hello

We do not have that available. However, you can still uses Joomla showon script like how we did in the backend.

1. Loads showon script:

if (EventbookingHelper::isJoomla4())
{
Factory::getDocument()->getWebAssetManager()->useScript('showon');
}
else
{

HTMLHelper::_('script', 'jui/cms.js', );
}

2. Add showon code, for example:
Code:
<div class="control-group" data-showon='<?php echo EventbookingHelperHtml::renderShowOn(array('user_registration' => '0')); ?>'> <div class="control-label"> <?php echo EventbookingHelperHtml::getFieldLabel('show_user_login_section', Text::_('EB_SHOW_USER_LOGIN'), Text::_('EB_SHOW_USER_LOGIN_EXPLAIN')); ?> </div> <div class="controls"> <?php echo EventbookingHelperHtml::getBooleanInput('show_user_login_section', $config->show_user_login_section); ?> </div> </div>

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

  • LAC Webadmin
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 3 months ago #148813 by LAC Webadmin
Replied by LAC Webadmin on topic Template Override on Edit Event View
This must be what I am looking for Tuan. I'll give it a try. So this is a Joomla 4 feature? I'm just starting to explore J4.

Thanks a lot!

Jackson

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

More
3 years 3 months ago #148814 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Template Override on Edit Event View
That actually works for both Joomla 3 and Joomla 4.

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

Moderators: Tuan Pham Ngoc