- Posts: 6
- Thank you received: 0
Option to show or hide register button for each menu item
- Javier Llamazares
- Topic Author
- Offline
- New Member
Less
More
4 years 7 months ago #134399
by Javier Llamazares
Option to show or hide register button for each menu item was created by Javier Llamazares
Hi,
I would like to be able to customize event timeline view so that, for each menu item using timeline view you can choose whether you want to show the register button or not.
I am aware you can configure hiding the register button in EB Configuration / Themes /
Show Register Buttons, but this would hide the register button everywhere, and this is not what I'm trying to achieve: I would like to show the button for certain menus but not for others.
===
So far I have added a new option at:
Which correctly shows the option for the menu item.
Can you point met to which files I should modify to add this functionality?
Many thanks!
Javi
I know you can choose not
I would like to be able to customize event timeline view so that, for each menu item using timeline view you can choose whether you want to show the register button or not.
I am aware you can configure hiding the register button in EB Configuration / Themes /
Show Register Buttons, but this would hide the register button everywhere, and this is not what I'm trying to achieve: I would like to show the button for certain menus but not for others.
===
So far I have added a new option at:
Code:
components/com_eventbooking/view/upcomingevents/tmpl/timeline.xml
Code:
<field name="hide_register_button_for_menu" type="list" default="0" label="Hide Register Button"
description="Choose to show/hide register button for this menu item">
<option value="0">No</option>
<option value="1">Yes</option>
</field>
Which correctly shows the option for the menu item.
Can you point met to which files I should modify to add this functionality?
Many thanks!
Javi
I know you can choose not
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
4 years 7 months ago #134425
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Option to show or hide register button for each menu item
Hi Javi
If you want to perform that customization, you will need to edit code on this file components/com_eventbooking/themes/default/common/events_timeline.php to change the behavior
Tuan
If you want to perform that customization, you will need to edit code on this file components/com_eventbooking/themes/default/common/events_timeline.php to change the behavior
Tuan
Please Log in or Create an account to join the conversation.
- Javier Llamazares
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
4 years 7 months ago #134439
by Javier Llamazares
Replied by Javier Llamazares on topic Option to show or hide register button for each menu item
Thank you Tuan, it worked.
I know this is very specific, and the code is probably quite hacky, but here's what I did, in case anybody else finds it useful:
In file:
Add:
Make a copy of file:
To directory:
Around line 48 add:
I know this is very specific, and the code is probably quite hacky, but here's what I did, in case anybody else finds it useful:
In file:
Code:
components/com_eventbooking/view/upcomingevents/tmpl/timeline.xml
Add:
Code:
<field name="hide_register_button_tlv" type="list" default="0" label="Hide Register Button"
description="Choose to show/hide register button for this menu item">
<option value="0">No</option>
<option value="1">Yes</option>
</field>
Make a copy of file:
Code:
components/com_eventbooking/themes/default/common/events_timeline.php
To directory:
Code:
templates/my_template_directory/html/com_eventbooking/common/
Around line 48 add:
Code:
$app = JFactory::getApplication();
$menuitem = $app->getMenu()->getActive();
$params = $menuitem->params;
if($params->get('hide_register_button_tlv'))
{
$hideRegisterButtons = true;
}
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
4 years 7 months ago #134453
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Option to show or hide register button for each menu item
Yes, that works. Thanks for sharing the code
Just please note that when you update the extension to new version, the change to the xml file will be lost, so you should make a backup of that file and restore it after updating
Tuan
Just please note that when you update the extension to new version, the change to the xml file will be lost, so you should make a backup of that file and restore it after updating
Tuan
The following user(s) said Thank You: Javier Llamazares
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.