10854 Posts in 2518 Topics by 1794 members
|Go to End||Next >|
5 October 2009 at 10:50am
Just an update. I have now updated the Trunk. Updates are:
Some tweaks to the templates, should be linking better now.
Latest version checking. The DashboardAdmin class uses the DOMDocument php class to screen scrape the Silverstripe SVN browser and pull out the latest version. It then compares to local version, and if out of date, shows an update message.
I would be interested to see how well this works for others?
8 October 2009 at 1:32am
To replicate the DataObjectManager error:
Click "edit" from the dashboard on a page with a DataObjectManager. Click "add," and you'll get the "I can't handle URLs..." error. Click the same page in the site tree to refresh, and the DataObjectManager works as expected.
It must have something to do with the URL being different? /admin/content/show/16 instead of just /admin/. I don't know. That's weird.
I have to check out that DOMDocument class. That sounds fantastic.
9 October 2009 at 9:54pm
This module look really promising!
One bug i found, on the dashboard where it lists the last pages edited, when you click on the edit icon it links to the wrong page.
Same goes for the 'View' all link, content instead of cms
Another thing thing i noticed, editing assets, the link contains a target="_blank".
I don't think this should be the default behavior.
Also, it would be nice if you could add multiple RSS feeds instead of just a single one.
Keep up the good work!
Loving it so far, thanks for this module!
9 October 2009 at 10:33pm Last edited: 9 October 2009 10:34pm
Here's a small patch for fetching the number of members
// Count query is faster then fetching all members and counting the rows
// Also check if they have atleast a single group assigned
$members = new SQLQuery(
'Member INNER JOIN Group_Members ON Group_Members.MemberID = Member.ID'
$memberCount = $members->execute()->value();
$membersStr = ($memberCount == 1) ? 'member' : 'members';
'Number' => $memberCount,
'Item' => $membersStr
10 October 2009 at 2:30am
I am aware, and have fixed the issue with the incorrect URL's in the trunk. Not added them to a new release yet, because I want to get the links in Silverstripe Navigator fixed.
I want to get the edit assets link to open in a lightbox popup, as if you were editing them from a tablefield. I am trying to work out if it would be easier try and use the prototype code in the core cms, or write my own jquery to do the same job.
The only trouble with multiple RSS fields is that I am not quite sure where they would go. I am trying to keep this simple and minimise the amount of clutter.
I will try your patch as soon as I get 5 mins (been a bit busy). I will also try and add some more features and release a new version.
10 October 2009 at 2:31am
10 October 2009 at 8:52am
DataObjectManager uses Facebox. It's pretty lightweight and easy to use.
10 October 2009 at 9:10am Last edited: 10 October 2009 9:16am
Okay, I couldn't help myself. I jumped into the Dashboard module today and tweaked it to be more customizable with an open API. The basic idea is that every component of the dashboard is a plugin. You can create a plugin by building a subclass of DashboardPlugin and assigning $position and $sort properties to give it a spot on the dashboard. There are a few other properties you can throw at it, as well, such as $icon and $link. Other than that, it's just straight ViewableData, so any functions you need to create are nicely contained within the plugin class and feed the corresponding template.
Let's look at an example. On my site, let's say my client has a custom page type and really wants a view of it on the dashboard. Let's use the old standby "Staff Member" page example.
class StaffMemberPlugin extends DashboardPlugin
static $position = "bottom";
static $sort = 1;
static $title = "Recent Staff Members";
static $link = "admin/cms/staffmembers";
static $link_text = "View All";
static $icon = "dashboard/images/22/gear.png";
return DataObject::get("StaffMember",null, "Created DESC");
Let's walk through this..
static $position: this plugin will go on the bottom, by where the "unmoderated comments" box is. Other choices are "left," "middle" (where "recent activity" is), and "top" (where "get updates" is)
static $sort: The sort order of the plugin in its given position. Duplicate sort values will get resolved arbitrarily by the controller.
static $title: Title for the header tag
static $link: Optional link for the header tag
static $link_text: Text fot the link. This defaults to "View All." This line is unnecessary unless you want to assign a value other than "view all." Shown here just for example.
static $icon: Optional link to the icon for the header
function RecentStaffMembers: We'll use this function on the template to get our list of staff members.
Now, on to the template.
<% if RecentStaffMembers %>
<% control RecentStaffMembers %>
<li>$Name, $JobTitle (<em>$Created.Ago</em>)</li>
<% end_control %>
<% else %>
<h4>There are no staff members.</h4>
<% end_if %>
All plugins are enabled by default. But let's say I want to get rid of the "Silverstripe News" plugin on my site.
The SSNews plugin is no longer visible on my dashboard.
That's it! In the ZIP file attached, I have modified the DashboardAdmin class to use plugins, and have migrated all the functions into their own plugin classes in /dashboard/code/plugins. They include: RecentFiles.php, RecentPages.php, SiteInfo.php, SSNews.php, UnmoderatedComments.php, and Updates.php.
Feedback and bug reports welcome. I think this will help make the dashboard more marketable to all kinds of sites now that users have the ability to create custom feeds. Let's keep this thing going!
|Go to Top||Next >|