One of our JCal Pro customers asked recently how to hide the following fields in the frontend "Add Event" page:
- Secondary Categories
All of these fields are optional. Hiding them if you don't plan to use them in your Joomla calendar only makes sense. And it will also make the frontend "Add Event" form cleaner for those who will be creating JCal Pro events for you.
Let's take a look at how to hide those four fields using the core Joomla component "Template Overrides".
Take a look at the default frontend "Add Event" form with the "Secondary Categories", "Language", "Location", and "Tags" fields displayed:
And now take a look at how the same page without those fields would look like:
Hiding those four fields is a two-step process:
- Create a template override for the JCal Pro "event" page
- Edit the template override for the JCal Pro "event" page
Let's take a look at this process in more detail.
Step #1. Create a template override for the JCal Pro "event" page
- In your Joomla administrator panel, go to "Extensions" > "Templates" > "Templates":
- You will see the "Templates: Templates (Site)" page listing Joomla templates installed on your site, as shown in the next image. Click on the name of your active Joomla template. In my example, I will click on the "Js_mondrian":
- This will bring you to the "Templates: Customize (your-joomla-template)" screen, as you can see in the next image. Click the "Create Overrides" tab:
- Under the "Components" column, click "jcal pro" and then click "event":
- You will see the message saying that your template override was successfully created:
Excellent! At this point, you are ready to move to the next step.
Step #2. Edit the template override for the JCal Pro "event" page
- On the "Editor" tab, click "html" > "com_jcalpro" > "event" > "edit.php":
- You will see the code of the edit.php file on the right side of the screen. Place the /* and */ symbols on line 100 and lines 106-108 to comment out the code, as you can see on the next image:
- Click "Save" or "Save & Close".
- Check the frontend page for creating a JCal Pro event. You should see that the required fields are now hidden, just as you intended.
Save $1000's when you sign up to Joomlashack's Everything Club.
You will get access to all our 32 extensions, templates, and Joomla training.