• 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.

    • This topic was modified 2 years, 8 months ago by johnmbd.
    • This topic was modified 2 years, 8 months ago by johnmbd.
    • This topic was modified 2 years, 8 months ago by johnmbd.
    • This topic was modified 2 years, 8 months ago by johnmbd.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello @johnmbd!

    You can resave permalinks from dashboard-> settings-> permalinks and check again, please

    Thank you!

    Thread Starter johnmbd

    (@johnmbd)

    Hello Kardi!

    Thanks for your response. I resaved my permalinks but it is still not working and gives the 404 error.

    Hello @johnmbd!

    Maybe you didn’t add the link and custom template properly.

    Please! follow the documentation : https://docs.themeum.com/tutor-lms/developers/editing-tutor-dashboard/#adding-new-link

    Thank you!

    Thread Starter johnmbd

    (@johnmbd)

    Hello!

    I tried adding this to my themes function.php file

    1.

    add_filter('tutor_dashboard/nav_items', 'add_some_links_dashboard');
    function add_some_links_dashboard($links){
    	$links['https://4learn.mydatau.org/dashboard/employees']          = __('Custom Link', 'tutor');
    	return $links;
    }

    and it did not work so I tried #2

    2.

    add_filter('tutor_dashboard/nav_items', 'add_some_links_dashboard');
    function add_some_links_dashboard($links){
    	$links['employees']          = __('Custom Link', 'tutor');
    	return $links;
    }

    and it did not work so I tried #3

    3.

    add_filter('tutor_dashboard/nav_items', 'add_some_links_dashboard');
    function add_some_links_dashboard($links){
    	$links['employees.php']          = __('Custom Link', 'tutor');
    	return $links;
    }

    I also created a employees.php file in my dashboard folder.

    Hello @johnmbd!

    You can contact direct support through this address support at themeum dot com.

    The team will help you.

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Linking a dashboard tab with a URL’ is closed to new replies.