I've seen a lot of posts of people wanting content that can be in a 2 (or more) column structure, a la most current news sites, particularly sites like The Onion.

This is a feature I wanted myself, and so I wrote it.

I didn't really know what I wanted at first, so I hacked something together. When what I was writing converged with what I needed, I realized that what I had would make a pretty good module.

Ideally the module would have a lot of fancy ways to choose the content, similar to the block administrator. This module doesn't have that. The effort::reward ratio isn't there for me. The fancier the interface, the more restrictive or the harder to use it is. Now, I realize that the way I have it set up is not the easiest to use, because it requires a tiny bit of PHP coding. However, much of the content that is likely to go into such a creature can be summed up in short PHP snippets.

I decided the best course of action was to do something simple and get the module out there. If other people want the slicker interface, perhaps someone else with an interest will take on the effort of writing it.

In any case, I present The Dashboard Module.

Documentation, such as it is, and examples (which are a little better) are available here. I'm using an older version of the same code on my site AssignBlame.

I welcome comments about this project.

Comments

jivyb’s picture

Thanks so much for getting this out there. I haven't implemented it, but I read through everything and looked at your examples and it looks fantastic. This has got to be a module that many people will be grateful for. At least for me, I think Drupal can now handle all of my site layout needs in a way I can figure out and manage.

jivyb’s picture

That's from download to having my new front page organized and up. I had to reorganize my taxonomy a bit and add some taxonomy blocks to display them in the dashboard. At some future point, I'll try to style it a bit, but it definitely works well out of the box. It's easier to implement and understand than you'd first think, so don't get scared off by the php stuff. The docs are excellent and will walk you right through.

merlinofchaos’s picture

Ooh! What's the URL? I'm curious to see what people are doing!

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

jivyb’s picture

www.sweetike.com

It's an out-of-the box implementation (actually the whole site is at the moment) of dashboard while I get it styled.

I also have a response to your comment that putting code in just one box has no use (that it won't really be any different than not using dashboard). Well there's one great use that I plan on using--displaying block content easily in the main column. The basic drupal doesn't have a straightforward way to display a block or non-node in the center column. Vice-versa, if you changed the widths of a left-right dashboard, you could use the right "column" to mimic the three-column drupal site that could display a node in the right column. Just some thoughts that I'll probably have a use for at some point.

This mod may not be fancy, but I think it's the best approach I've come across to this need of adding columns and blocks to a standard site. If in 4.7 you can put blocks anywhere, great--but that still implies that you have to be smart enough to lay out your site to accommodate them by creating your own theme. That can get really complicated for people who are not full-time coders.

Also, do you think there would be a way to use the dashboard mod as a wrapper?

Thanks again for the mod!

merlinofchaos’s picture

You can use the dashboard functions in any node with php filtering; so if you want to use just one box, you're better off using the 'page' node and putting your code in there, for simplicity of maintenance.

Your mention of the CSS reminds me that I left something important out of the documentation. The summary is that you should put CSS overrides in your theme, rather than in the dashboard.css, to be sure that you get what you want. I will be sure to put more on this in the documentation.

I was about to answer your question about being a wrapper, then I realized you could mean several things, so I need you to clarify what you mean by wrapper.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

jivyb’s picture

That's good to know about being able to use the functions in any node with php filtering.

If I use the theme's css sheet and if I want to have a-link styling unique to the dashboard, what should I do? Or for any other style variables that are not uniquely defined in the dashboard.css style sheet. Is it possible using the theme's style.css?

About the wrapper, I just was thinking of other cms's like joomla and xaraya and website baker, all of which I've used to some degree before settling on drupal. They all have a wrapper function where you enter in a url and define some display variables to put an outside page within an iframe in your site.

Thanks.

merlinofchaos’s picture

Yes, you want to put the CSS in your theme's style.css.

In the style.css in your theme:

.dashboard a {
  font-weight: bold;
  font-size: 1em;
}

If you use the dashboard names, you can style each dashboard individually with

#component-NAMEYOUPICKED a {
  font-weight: bold;
  font-size: 1em;
}

As for the wrapper, I'm not sure. You might be able to with PHP, but I'm not sure what the code would be offhand, or how Drupal would handle it. You might post in the forums about including foreign URLs in Drupal via PHP snippet and see if anyone knows whether it's both doable and safe.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

jivyb’s picture

I hope I'm not too off topic here, but can I style the dashboard by your content regions: top, left/right, bottom or does it have to be by the whole dashboard or the individual components? When I added style codes to the .dashboard div--a background color-- it applied it only to the top region and I don't know why.

Also, the block titles and the links listed inside them have the same div or something, meaning that when I change the style for the h2 it applies the style to the block headers as well as the links. Is there a way to separate this out? I suspect this is just a pushbutton thing, but I don't know.

Thanks.

UPDATE: ok to style by region, I should use #top, #left, etc

merlinofchaos’s picture

For links use
.dashboard h2 a

or

.dashboard a

depending on whether or not their inside an anchor.

As far as I know, most everything should be pretty well self-contained, but I can't really speak for content provided by an individual block. But it should be stylable just like the sidebar, only under the .dashboard ID.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

jivyb’s picture

thanks so much. that works for changing the size of links, but I put in a border-bottome line in the .content h2 that is applied to the block titles and links but I'd like it to just be under the block titles. any ideas?

jivyb’s picture

I can style only the links but not only the block titles with the .dashboard h2 a {

Whatever style is applied to the block titles is always also applied to the links...

thanks

merlinofchaos’s picture

In that case, what you apply to the links you'll have to un-apply to the h2.

.dashboard h2 {
  border: bottom blue 2px;
}

.dashboard h2 a {
  border: none
}

Kind of annoying, but it should work.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

jivyb’s picture

for some reason doesn't take the pesky lines away. Oh well! It's not the first time I've been stymied by css, as great as it can be. I'm still new enough to be mystified from time to time.

I do appreciate your taking the time to help me with css in addition to supporting your module.

I have one suggestion about dashboard: it might be good to advise newer users to disable tinymce (if they use it) before putting the code in the fields. If you just fill out the fields from top to bottom, the last you would do would be to check the php content type but by then, tiny would have already reformmated their code with html tags.

merlinofchaos’s picture

Ewwwww, that's unfortunate. I'll edit the readme file. Thanks for the warning.

For the CSS bit, you'll have to figure out what's putting the lines there and then remove that. I'm not sure offhand. CSS is something I'm able to hack together but I'm not really an expert there.
-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

sangamreddi’s picture

Hi,

It's easy to use and have robust features.
I am actually looking for the documenation and i found it here.

Thanks for such a nice module

Sunny
www.gleez.com

qolspony’s picture

I want to first thank you for creating the Dashboard Module. With that said, I think I'm running into problem. ALthough I was able to include the module on the Drupal admin end, I can't find it in the list of settings.

Not being as technical as everyone on these forums I took a look at the "INSTALL" file included in the installation. It instructs me to:

"1. Copy the dashboard directory to your drupal/modules directory. Drupal will automatically detect it."

done

"2. Run mysql -u youdrupaluser -p yourdrupaldb < dashboard.mysql to create the dashboard table."

Please give more explanation

"3. Proceed to your Drupal site and enable the module in "administer > modules". Also make sure that the Upload module is enabled."

Done.

You may now create dashboard nodes.

Please give more explanation

Thanks for your help.

merlinofchaos’s picture

"2. Run mysql -u youdrupaluser -p yourdrupaldb < dashboard.mysql to create the dashboard table."

This is fairly common in modules. Basically this means that the module has a special table in your database. When you installed Drupal you should have run a similar operation for your database.mysql (or database.pgsql if you are using PostgreSQL.)

You may now create dashboard nodes.

You can create a dashboard just like you would create a static page, because the dashboard creates a node type. It doesn't create any options under the Administer window.

You want to look in your "Submit Content" menu for the 'dashboard' entry.
-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

venkat-rk’s picture

I think the reason you are not able to see it in settings is because the sql file is not loaded.

If you have phpmyadmin installed on your hosting account, it's much easier. Log in with your drupal database username and password, click on the database name in the left column and then click on 'SQL' in the right pane at the top of the page that comes up next. You will find a 'browse' field. Use this to locate the dashboard.mysql, select it and click on 'Go'. This will load the mysql table and you will now be able to see it under settings.

The "Run mysql -u youdrupaluser -p yourdrupaldb < dashboard.mysql to create the dashboard table" will work if you have shell access to your hosting account *and* if your database is on localhost- that is, on the same server as your hosting account. If you are more comfortable with this, use a program like PuTTY to connect to your hosting account, change to the modules directory of your drupal install and then run the command starting with mysql, replacing 'drupaluser' with the username of your database and 'yourdrupaldb' with the name of your database.

I suspect the former will be easier.

merlinofchaos’s picture

Aha! I haven't personally used phpmyadmin, so I was unfortunately unable to give directions on its use. I'm glad someone else read this who can.

I ought to install it sometime, from what I've seen it's a very nice tool and could probably save me a little time. I do a lot of manual database querying while developing. Old habits, I guess.

At least it's not sqlplus. Ugh.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

skollfoundation’s picture

I'm running vbdrupal (drupal in conjunction with vbulletin) and someone suggested I tried this plugin to help with the layout of my homepage.

I've uploaded the module and can see it in the admin

I've logged into phpmyadmin and clicked on sql to browse and run the dashboard.mysql file

I've enabled the module.

I've clicked on create content > dashboard. .... and all I get is page / story / blog entry ... with no mention of Left / Right / Bottom areas to insert php code on any of them.

Am I missing something here??

venkat-rk’s picture

Are you logging in as admin or as a different user?

If the latter, you should enable permissions for that user for dashboard at administer>>access control>>permissions>>dashboard

merlinofchaos’s picture

This sounds like the kind of problem you can get when you install the 4.7 version in a 4.6 Drupal.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

jivyb’s picture

I'm getting server not found errors...

merlinofchaos’s picture

Weird. Everything seems to be fine to me. Though we were using tons of bandwidth about the time you posted, so maybe you were getting congested out.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

jivyb’s picture

I don't know how much buzz you've had for this module but if there's interest of others to help out, it would be cool to have some different dashboard layouts available to use. I was just reading the template handbook on the template regions for 4.7 and even though there's going to be great flexibility in layouts, each person would still have to do the css, html, and phptemplate and php changes for everything.

In other words, it's definitely not "plug and play". And for those who know how and want to contrib to the community, designing a different dashboard layout would probably be a lot simpler than designing a new template. And because the dashboard is used in conjunction with a drupal layout, you actually have a lot of options depending on which drupal columns you use with in conjunction with the dashboard regions you choose.

Just an idea--it sounds great to me, anyway!

merlinofchaos’s picture

Different layouts could be done as CSS plug-ins, because the dashboard is just 4 divs that are arranged that way. Depending on what you want it may be just a minor tweak to the CSS.

For example, the default dashboard layout has both columns the same size, but by adjusting the width field in the left and right boxes in the CSS, it would be easy to make one smaller and one bigger. (Just make sure everything adds up to 100).

Once you've got a handle on doing that, you can do a 3 column layout by adjusting 1 column to be 65%, the other to be 31% (the other 4% being the padding in the middle) and them embedding another dashboard inside the larger one.

You'd definitely want to do that only for particular named dashboards, but that isn't too hard. That would probably be a good addition to the documentation and/or examples.

Are there other configurations you can think of that would be interesting?

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

jivyb’s picture

A row of three (or even four) smaller boxes would be cool:

x---x---x---x
|   |   |   |
x---x---x---x

As would being able to split the top or bottom sections into two:

x-------x---x
|       |   |
x-------x---x

What do you think? Would this best be done by embedding dashboards as you mentioned above? If so, I'll need some help/explanation on how... Thanks for all your support with this, by the way!

merlinofchaos’s picture

You are on the right track. I've been meaning to do up an example of a 3 column using 2 dashboards.

The first dashboard would have a large left column and a large right column. To change that for just that dashboard, name it something like 'largeleft'.

Then, add this CSS to your style.css

.component-largeleft #left {
  width: 65%;
}

.component-largeleft #right {
  width: 32%;
}

.component-largeleft #middle {
  width: 2%;
}

Making the middle smaller will compensate somewhat for the middle part of the embedded dashboard on the left be a little smaller.

You should then be able to simply embed another dashboard on the left side to get a 3 column setup. For information about that, look at my example document.

I also realized that the above being named .component-largeleft is a bug; it should've been .dashboard-largeleft but I must've left something in from cut&paste. Oh well, not a good idea to change it midstream and it's only a minor issue.

Caveat: I'm trying to do this quickly so I can move on to other work today, so I haven't tried this. Let me know if it works, tho; if it does I'll put it in my queue to add as an example.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

sangamreddi’s picture

Hi,

It's pretty good and everything fine, just now i found a problem with it. I tried with different drupal instances but the result is true.

Dashboard Name (for CSS) is not being rendered. Suppose if we give a dashboard name as "welcome" and submit it's working. It's fine until this.
When i edit the same dashboard again the Dashboard Name (for CSS) defaults to blank. This makes the layout looks different and it's hard to remember the CSS name. I need to manually check the stylesheet or dashboard tables for the CSS name"welcome".

Thanks in advance.

Sunny
www.gleez.com

merlinofchaos’s picture

I'll look into this; could I get you to submit this as a bug report for the project (From the dashboard module page) so it can get tracked for everybody interested in the project?

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

vthirteen’s picture

the module works fine, thanks. one thing i didnt understand:

in the doc files it says:

"Second, modules can simply use theme_dashboard() to create custom dashboards. For many uses, this is without a doubt the most powerful way to do it, but it is not necessarily the most convenient, especially for administrators that are not the most comfortable with code."

i'm not sure what you mean, but i know what i want to get: something like your website home page ( http://www.assignblame.com/ ), where in the 'top' area of the dashboard there is (i suppose) the last promoted node with its title.every other area of the dashboard has its own title and the whole dashboard has no title of its own.

hope you understand what i mean.
thanx in advance!

pirgeri’s picture

have you or anyone found a solution for this problem: no title in dashboard? and no post info either...

thanx

merlinofchaos’s picture

The easiest way to accomplish this is, if using a phptemplate theme, to create a node-dashboard.tpl.php that has all of the post info stripped away.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

andysmart’s picture

I read the readme.txt and this discussion but still I couldn't understand how do I assign a php snippet to a region of the dashboard node.

When I get to ?q=node/add/dashboard the content I see is just the same as in ?q=node/add, as well as when I choose to write a 'story' from within the add/dashboard node I land on this node: ?q=node/add/story

So I think I missed something in the installation or the readme file.

How do I write a dashboard then?

Andrea

Skatecoffee.net
the flavour of skateboarding

venkat-rk’s picture

There is detailed documentation available here. Might help you:
http://www.logrus.com/dashboard

merlinofchaos’s picture

When you go to node/add/dashboard you should see 4 'body' type fields (You may have to scroll down to see them all).

If you don't see them, go to admin/modules and make sure you have the dashboard type enabled properly.

I can't think of another reason this might fail, though perhaps using the 4.6 version of the module with Drupal 4.7 or vice versa could cause strange problems.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

andysmart’s picture

Actually I can't see the 4 body fields, so maybe it's because I downloaded last version and using D 4.6.

I replaced it and now it works, thanks a lot!

Andrea.

Skatecoffee.net
the flavour of skateboarding

jivyb’s picture

You have a tutorial on displaying nodes and blocks. Is there a way to just get, say the last 3 items of a taxonomy term to display in the same way you got the last 3 items of node-type "recipes" to display in your example? Does that make sense?

merlinofchaos’s picture

Yes, it does.

If you're using 4.6 (I assume you are) you're best off using a PHP Snippet.

A snippet that I think is very close to what you want is http://drupal.org/node/23232.

The comments show several ways to customize it to do what you need.

If you're using 4.7, you can use the Views module a lot more easily.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

divrom’s picture

I must be having a thick day, because I can't get this to do what I want - even though I'm sure it can.

I'd like to use dashboard for one of my books so that the top page of the book (or, at least, what appears to be the top page) shows the title and teaser of its children. Is that possible with dashboard?

merlinofchaos’s picture

I'm not quite sure what you mean offhand unfortunately.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

divrom’s picture

My site is organised by books (not taxonomy). And I was hoping to use a dashboard for the top page of one of those books. My idea was that I could have a page that showed the body of the top page of book 1, along with the title and teasers of book 1's children.

Is that possible? Someone suggesting using views instead, but I'm even less sure about that module! (Both would seem like a powerful combination, but both are beyond me.)

merlinofchaos’s picture

Hmm. Views doesn't (yet) know about book parents, though that's an obvious inclusion that just isn't in there yet, and I should certainly add. Without that, for now I think your only choice will be to make a modified version of theme_book_navigation() which will require you to understand a bit about how the system works.

-- Merlin

[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

-- Merlin

[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]

divrom’s picture

I thinks that a bit out of my league, but thanks for your help anyway.

venkat-rk’s picture

Divrom, I am sorry if I pointed you in the wrong direction and wasted your time. I realised only late yesterday that views doesn't yet support books.

divrom’s picture

I suspect that I 'll end up doing this one thing via a flexinode. (I've tried to keep it all books, no taxonomy, as I'm designing it for a bunch of technophobes.)

However, I guess I can still make this look like a book and then use dashboard to style it as I wanted?

venkat-rk’s picture

Not sure exactly what you mean by making it look like a book.

But you can use one of the many snippets to call the flexinode data (I would look for one that prints out teasers), put the code or the info for the block generated by the code (if you put the code into a custom block) into the dashboard and then style it.

divrom’s picture

and a little CSS.

This is close enough to what I'm after. Cheers.

(If I could just add pagination I'd be delighted!)

venkat-rk’s picture

Nice!

For pagination, you can use either the paging module or Kitt Hodsden's pagination module although I don't know if it is still available or maintained:
http://drupal.org/node/23362#comment-61447

divrom’s picture

Brilliant info, Ramdak.

Cheers. (Ain't the open source community great? :-) )

venkat-rk’s picture

Glad to have been of some help:-)

You can keep track of the latest contrib modules at www.drupal.org/taxonomy/term/14

oweowe’s picture

I tried the dashboard along with taxonomy block module in Drupal 4.7 and it worked fine as a node page. But once I tried to promote to the homepage, it shows "Dashboards have no teaser, sorry."
I am wondering how you apply dashboard to the homepage like http://www.logrus.com/. Does that need additional module(s)?
Thanks!

enli’s picture

You have to set dashboard to be a homepage by using yoursite.com/admin/settings, in "General Settings"; there you can set the dashboard page to be your homepage, by adding the new node (example: "node/69") instead of the default "node".

enrico
http://www.viridis.it

oweowe’s picture

Thanks a lot, enrico!
BTW, is there any way to get rid of "Submitted by (user) on (time)." shown on the top of the node?
Thanks again!

jivyb’s picture

I use the following to not display breadcrumbs or the author info. This goes in the dashboard.css file in the dashboard folder.

.dashboard .breadcrumb {
display:none;
}
.dashboard .info {
display:none;
}

You can do it another way by copying your theme's node.tpl.php file and renaming it node-dashboard.tpl.php and then taking out the things you don't want--even just leaving the code for the content only.

tracerrx’s picture

For some reason this doesn't work in 4.7?

Michelle’s picture

Dashboard has been superceded by the panels module anyway... Have a look at that.

Michelle