• Resolved Maxen

    (@maxenmg)


    Hi guys. Love your plugin! Oxygen integrations is working great!

    But, at the same time I have one big problem. Including the fact everything is set up, courses, lessons, quizzes are working, dashboard endpoint just don’t. All I get is redirect to homepage. At the same time I didn’t found any mention on setting up dashboard endpoints in your documentation.

    Is there some shortcodes to reproduce endpoints in Oxygen builder?
    Maybe I need to create specific templates for them?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Maxen

    (@maxenmg)

    Again, when I am pasting endpoint php code to separate page and run it, it working.

    It seems we need additional template whitch will catch all dashboard endpoints and outputs their php code in some container.

    Thread Starter Maxen

    (@maxenmg)

    I see you are using tutor_load_template("dashboard.dashboard"); to load needed php template to current page.

    It means than somehow, all that is wrong is page which we are loading in result, because I am redirected to home page all the times… If we are redirected to dashboard page, and you can pass subpage slug, we will have same page with working dashboard…

    And it means that our setting of Dashboard page in Tools just don’t work properly.

    Thread Starter Maxen

    (@maxenmg)

    First of all, when we are setting dashboard page slug in wp to /dashboard problem with redirects to homepage goes away. Links finally start to load correctly.

    It means I can create all dashboard subpages and insert needed php template, at least, or use Oxygen template.

    And, as far as I see, your problem lies here:

    
    if (isset($wp_query->query_vars['tutor_dashboard_page']) && $wp_query->query_vars['tutor_dashboard_page']) {
        $dashboard_page_slug = $wp_query->query_vars['tutor_dashboard_page'];
        $dashboard_page_name = $wp_query->query_vars['tutor_dashboard_page'];
    } else {
        $dashboard_page_slug = $wp_query->query_vars['tutor_dashboard_page'];
        $dashboard_page_name = $wp_query->query_vars['tutor_dashboard_page'];
    }
    

    Your variables $dashboard_page_slug and $dashboard_page_name are empty as a result…

    Thread Starter Maxen

    (@maxenmg)

    In case support will not give better fix for Oxygen Builder users, what worked for me:

    1. Change your profile page slug to /dashboard, it must stop redirects to home page if you have them.

    2. Create separate Oxygen template for profile pages. It must contain code block where you will insert custom php code.

    3. Copy code of tutor/templates/dashboard/index.php template to your code block.

    4. Our problem lies in empty variables $dashboard_page_slug and $dashboard_page_name. As a result add code

    
    /**
     * Fixes to not working Tutor code for Oxygen
     */
    
    $mxn_base = '/dashboard';
    $mxn_url_clear = str_replace("/", "",str_replace($mxn_base, "",trim(strtok($_SERVER['REQUEST_URI'], '?'))));
    
    $dashboard_page_slug = $mxn_url_clear;
    $dashboard_page_name = $mxn_url_clear;
    

    after line 25.

    5. Create needed pages similar to Tutor Dashboard links and assign your Oxygen template to them.

    As a result template will take variables from link, and pages will load correctly. Biggest minus for this – we need to create all those pages and links must match with tutors menu in dashboard.

    • This reply was modified 4 years ago by Maxen.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Dashboard Endpoints not working with Oxygen Builder’ is closed to new replies.