Forum

Thread tagged as: Question, Problem, Api

Dashboard widgets

I've followed the tutorial for creating a dashboard widget in the docs here: https://docs.grabaperch.com/api/dashboard/

I've done everything exactly as described, to the point of downloading the files and using them exactly as they are. Nothing seems to work. If I reload the dashboard nothing appears. The app does display in the sidebar despite setting the variable to false which according to the docs means it wont show up. If I click on the app link in the sidebar I get:

You don't have permission to access /admin/addons/apps/prefix_appname/ on this server.

Any pointers as to how this is supposed to work? I have no PHP errors in the log. The dubug on the dashboard page looks like:

Debug Message - Perch Runway 3.1.1
[1] SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='bead7a7a195c78378ef16f41d57e2267' LIMIT 1
UPDATE perch2_users SET userHash='a4a19cd29f294164f3b7a039ed97df76' WHERE userID='1'
[47] SELECT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
Adding: App name
[17] SELECT itemValue FROM perch2_menu_items WHERE itemType='app'
[nil] SELECT *, REPLACE(pagePath, '/index.php', '') as sortPath FROM perch2_pages WHERE pageNew=1 ORDER BY LENGTH(sortPath)-LENGTH(REPLACE(sortPath, '/', '')) ASC
[16] SELECT p.*, (SELECT COUNT(*) FROM perch2_pages WHERE pageParentID=p.pageID) AS subpages FROM perch2_pages p WHERE p.pageParentID IN (0, 19, 8) ORDER BY p.pageTreePosition ASC
[46] SELECT * FROM perch2_content_regions ORDER BY regionOrder ASC
[4] SELECT * FROM perch2_content_regions WHERE regionPage='*' ORDER BY regionKey ASC
[1] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
[12] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
[1] SELECT itemTitle FROM perch2_menu_items WHERE itemType='app' AND itemValue='content' LIMIT 1
[1] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
[2] SELECT mi.*, p.privKey FROM perch2_menu_items mi LEFT JOIN perch2_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
File: /core/apps/content/modes/list.post.php
[31] SELECT DISTINCT regionTemplate FROM perch2_content_regions ORDER BY regionTemplate ASC
Queries: 15
Memory: 4.4998
Rob Saunders

Rob Saunders 0 points

  • 3 years ago

I'm not saying this is the best coding in the world but my Dashboard Links Widget https://github.com/clivewalker/Perch-Dashboard-Links-Widget is simple and I know it works. That might give you a few pointers?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Looks like that tutorial is for Perch 2, so it won't work with 3. Apologies, I'd completely forgotten it existed.

Ah that explains it!!

Thank You Andrew I'll take a look through your code. Much appreciated.

For all others...there is also an option within settings where you have to "turn on" the dashboard. It doesn't mention this anywhere in the docs so I missed it until playing about with the settings in Clive's App. No dashboard widgets will show up without this being on...