Linking a dashboard tab with a URL
-
I created two tabs on the left panel called “Employees” and “Statistics” using the following code in the tutor/templates/dashboard.php file
<div class="tutor-row tutor-frontend-dashboard-maincontent"> <div class="tutor-col-12 tutor-col-md-4 tutor-col-lg-3 tutor-dashboard-left-menu"> <?php if($role === "organization"): ?> <div> <ul class="tutor-dashboard-permalinks" > <li class="tutor-dashboard-menu-item tutor-dashboard-menu-settings"> <a href="#" onclick="clickEmployees()" class="tutor-dashboard-menu-item-link tutor-fs-6 tutor-color-black"> <span class="tutor-icon-user-bold tutor-dashboard-menu-item-icon"></span> <span class="tutor-dashboard-menu-item-text tutor-ml-12">Employees</span> </a> </li> <li class="tutor-dashboard-menu-item tutor-dashboard-menu-settings"> <a href="#" onclick="clickStatistics()" class="tutor-dashboard-menu-item-link tutor-fs-6 tutor-color-black"> <span class="tutor-icon-dashboard tutor-dashboard-menu-item-icon"></span> <span class="tutor-dashboard-menu-item-text tutor-ml-12">Statistics</span> </a> </li> <?php
Here is a screenshot of it https://ibb.co/MG74rv8.
It is working fine but the address changes to https://mywebsite.org/dashboard/# instead of https://mywebsite.org/dashboard/employees and I am trying to figure out what alternatives instead of using onclick=”function” and add an actual address like href=https://mywebsite.org/dashboard/employees
I found that in tutor/templates/dashboard, the php files for the left dashboard tabs are there https://ibb.co/MsqLrmF and if I made some changes, for example, to the settings.php and went to https://mywebsite.org/dashboard/settings then I would see the change.
So to test it out, what I did was create an employees.php file and added
<?php /** * @package TutorLMS/Templates * @version 1.4.3 */ ?> <h1>BONJOUR!</h1>
Then I changed the href=https://mywebsite.org/dashboard/employees in my dashboard.php file and when I clicked on the Employees tab in my dashboard, I get “a 404 Error!” https://ibb.co/crmD1Y1
Can someone point me in the right direction? Thank you.
- The topic ‘Linking a dashboard tab with a URL’ is closed to new replies.