Creating a dashboard page
Author | Posts |
---|---|
April 13, 2015 at 4:59 am 41186 | |
towhid | I have hooked into the dokan dashboard menu and have added a menu item. function my_function( $urls ) { $page_id = '1'; $urls['zip'] = array( 'title' => __( 'My Tab', 'dokan'), 'icon' => '', 'url' => get_permalink( $page_id ) ); return $urls; } add_filter( 'dokan_get_dashboard_nav', 'my_function' ); I then created some shortcode to to add into a page. The page loads when I click on the new tab that I created, however it is not styled like the other dashboard pages. What do I need to do to make the linked page look like other dashboard pages? |
April 13, 2015 at 10:45 am 41202 | |
towhid | Hello Bryan, Please allow me some time to workout with your code as a test purpose. After then I will give you a reply. Thank you 🙂 |
April 15, 2015 at 2:34 am 41347 | |
Bryan | The following code is what I have currently come up with. This code will create a new dashboard menu item and connects that link to a page that has been created with shortcode. Additionally this code check to see if the user is logged in and allowed to sell items. The only thing that I cannot seem to get working are the styles and scripts associated with the dashboard page. What are the styles and scripts that I would need to load to get this new page looking like the others? __( ‘New Tab’, ‘dokan’), return $urls; add_filter( ‘dokan_get_dashboard_nav’, ‘x_dokan_new_nav’ ); /* add_action( ‘template_redirect’, ‘x_dash_redirect’ ); /* $user_id = get_current_user_id(); ?>
‘test’ ) ); ?>
Test!
|
April 15, 2015 at 2:24 pm 41406 | |
towhid | Hello Bryan, Can you please let me know in which file you have paste this code? Thank you 🙂 |
April 15, 2015 at 6:37 pm 41428 | |
Bryan | I have placed this file in a new plugin file. There is another file within that same plugin file which activates the plugin and includes this file. I have not changed any of the core dokan files. Everything is working it is just the css and perhaps some js that is not loading. There are a lot of css and js files loaded on the dashboard pages and I am having a hard time figuring out which ones need to be included in the new dashboard page. |
April 17, 2015 at 6:45 pm 41606 | |
Bryan | Any luck on this? |
April 18, 2015 at 6:36 pm 41702 | |
towhid | Hello Bryan, Sorry for my late reply. Please allow me some time. I will be back to you as early as possible problely tomorrow I will try to reply something as my best. Thank you 🙂 |
April 18, 2015 at 8:17 pm 41706 | |
Bryan | No worries. |
April 21, 2015 at 5:14 pm 41921 | |
towhid | Hello Bryan, Can you please followup my instruction and see how it sees: Step 1: Please create a page named “mytab.php” under Step 2: Please open plugins
Step 3: Please open
After then you will see a menu named “My Tab” with same design of other dashboard page. Try this instruction and let me know the result. Thank you 🙂 |
April 24, 2015 at 8:46 am 42176 | |
Bryan | The tab appears, however when I click on it it states “That page cannot be found”. Is there a specific location within these files that I need to add this code to. Also I am using the most recent version of the Dokan theme with the plugin if this helps any. |
April 25, 2015 at 11:20 am 42211 | |
towhid | Hello, Make sure you have set your permalinks as post name and product. Please navigate to Settings->Permalinks and Set your permalinks as Post name and Product. Please check and let me know. Thank you 🙂 |
April 25, 2015 at 8:22 pm 42259 | |
Bryan | This works!!! The only issue now is that the active tab is not highlighted. I have used the following code within the mytab.php file: ‘mytab’ ) ); ?> If I change ‘mytab’ to another menu name such as ‘settings’, the ‘settings’ tab will display as active, it only seems to not work for the new tab. What could be causing the the “My Tab” to not display as the active tab? Thanks for getting this working as well as it is by the way. |
April 27, 2015 at 12:50 am 42385 | |
Bryan | I got it working. the code you provided worked fine, I made a syntax error. Thank you for your help on this issue. |
April 27, 2015 at 10:11 am 42394 | |
towhid | This reply has been marked as private. |