Multiple dashboard
Author | Posts |
---|---|
May 31, 2013 at 2:38 pm 4385 | |
Tareq Hasan | Hi Tarek !
In my project, as you know, users can create multiple companies and multiple post types for each company(each post has a "company_id" custom field related to the right company's id).
Right now, I have a page which lists the user's companies. Newt to the company's name, I have a link to a dashboard page which lists the posts related to that company (thanks to $args['meta_query'] in wpuf_dashboard_query ).
This configuration is not optimal for the UX. We have discussed it a lot and here is what we would like : New structure
So as you can see, we want everything in a single page : the list of the companies, and multiple "dashboard", each related to his company. Is it possible to do that as it's now or do I have to make it myself, and recreate the dashboard table with wp_query/get_posts... ?
I also want to add a post_type column in the table.
Thank you for your great support :) ! |
June 3, 2013 at 7:40 am 4457 | |
noomia | Hi Tarek ! Have you got any news 🙂 ? |
June 3, 2013 at 4:53 pm 4476 | |
Tareq Hasan | Is there any problem using multiple dashboard shortcode on that page? PS: Spelling of name would be “TareQ“ |
June 4, 2013 at 2:25 pm 4535 | |
noomia | Hi and sorry TareQ 😉 Is it possible to add dashboard query in the dashboard shortcode ? |
June 4, 2013 at 3:13 pm 4537 | |
Tareq Hasan | No it’s not currently. But you can add filters based on post type 🙂 |
June 4, 2013 at 3:23 pm 4540 | |
noomia | I don’t understand how I could achieve that… I need multiple dashboard… Each dashboard has to display the news/projects/jobs/events that has a specific value for the custom field “company_id”. I achieve that for the dashboard page thanks to your dashboard query filter. But how achieve that for multiple dashboard on same page ? With the shortcodes ? |
June 4, 2013 at 10:49 pm 4556 | |
Tareq Hasan | With the dashboard filter, you get the arguments as a parameter, right? And you give different post types in the shortcode. Ex: |
June 5, 2013 at 7:46 am 4568 | |
noomia | In fact, right now, I have one page for each company, so I can pass the ID of the company through the url and retrieve this id. So I have that code :
But in the new case, I have all the companies on the same page, so I can’t pass the company ID through the url because it’s not a single ID, maybe 50, and it’s bad in the url. I have a loop to display each company in the loop. In that loop, I have to call the dashboard and pass the company_ID, in the loop, as an argument but I don’t understand how… In the Thank you for your answers, I’m a little bit in a hurry for this functionnality 😉 ! |
June 5, 2013 at 7:57 am 4569 | |
Tareq Hasan | I was talking about something like this: [php] if( $args[‘post_type’] == ‘company’) { return $args; add_filter( ‘wpuf_dashboard_query’, ‘wpufe_dashboard_post_type’ ); |
June 5, 2013 at 8:11 am 4570 | |
noomia | I’m afraid you don’t understand everything 😉 ! I have the “companies” post type. In the loop, I display all the companies. It’s a classic loop to get the custom post type “companies”. In that loop, for each company, I need the WPUF dashboard. This dashboard has to display the 4 others custom post type : “news”, “jobs”, “projects”, “events”. Not the “companies” post type. But each dashboard has to displays the 4 posts types that has a the good company_ID. So if in the loop we are displaying the company with ID=64, the dashboard has to display the post types “news”, “jobs”, “projects”, “events” where the custom field company_ID=64. Do you understand ? So I only need a way to retrieve the ID of the post where the dashboard shortcode is called… |
June 5, 2013 at 8:49 am 4571 | |
noomia | Like with the Hook, we can retrieve the post_id (and the form_id)
Could be great to retrieve the post ID for dashboard… |
June 5, 2013 at 9:24 am 4574 | |
Tareq Hasan | If it’s a WordPress loop, you can access |
June 5, 2013 at 9:37 am 4575 | |
noomia | Nice, well done, it’s working 🙂 ! Is there a way to change the Dashboard Title ? And to add a column in the dashboard table ? |
June 5, 2013 at 10:03 am 4578 | |
Tareq Hasan | Dashboard title, NO. |
June 5, 2013 at 12:06 pm 4583 | |
noomia | Last question. Is it possible to get the number of posts that are displayed in the dashboard ? You display it in a full sentence, I only need the number… Thanks |
June 7, 2013 at 6:40 pm 4665 | |
Tareq Hasan | You can’t change it in the dashboard, there isn’t any filter for that. |