Preamble
I do understand that no more work is being done on the Drupal 6 version of this module, but as it's Drupal 6 I'm using and I know lots of people still use it, I've made some enhancements which I thought I'd share.
I know there must be a lot of people out there who don't like to go near PHP or jQuery - or whatever else - and who consider themselves "designers". Although I've written these changes (with a little help), I like to configure a Drupal site as much as possible without touching code, because generally I don't understand where to start.
These enhancements were made with easier theming in mind. I looked at the provided block and thought it was handy, but could do with some more (classes, links, options etc.). I also realise from looking at the .MODULE file that hook_theme was implemented to allow the presentation to be move to the template and rewritten. But, again, for people who shy away from that, I thought this might make things a lot easier to theme - now you just have to set these options and amend CSS.
So for those people who want point-and-click options to configure their Drupal site, and want to configure more in the LoginToboggan Logged In Block than just a username and logout link, this might be for you...
Summary of changes
To be honest, if like me, you don't know how to apply a patch, then I've provided just the modified files. The modified files are (zipped, for your pleasure):
- logintoboggan.INSTALL (changed to include the new database variables for a clean uninstall)
- logintoboggan.MODULE (functional changes to the block configuration page)
- logintoboggan_block_settings.js (some small jQuery to make the UI experience all-the-more usable)
I suppose I should mention these changes were made against LoginToboggan 6.x-1.9! Just move them straight into your "logintoboggan" module directory. Nothing else is required.
So what does this bring to the table?
What's new
If you now go to the administer blocks screen /admin/build/block and configure the "LoginToboggan logged in block" you'll see the following (all-new) options:
- Radio buttons: Elect to use the logged in username (default) or your own replacement text for the account in the block.
- Checkbox: If you use the account name this allows you to optionally hyperlink the username to their account page.
- Textbox: Enter the replacement text (default "My account", without quotes).
- Radio buttons: Select the list style of the links, either inline (default) or as an unordered list.
- Textarea: For inline presentation, configure the delimiter between the two links (default "|", without quotes).
- Checkbox: For an unordered list, this applies class="menu" to the <ul> so it can be styled easily along with Drupal menus.
I've also added some classes into the code that make it easier to style "out-of-the-box" with CSS.
Drupal 7
After writing these changes, I installed Drupal 7 and the corresponding module and took a look at that, and was considering writing the same changes to offer at the same time. I can still do this if people like what they see and would like the options, but I considered it wasn't worth doing on the basis that Drupal 7 already provides pretty much all this functionality already in different ways.
For example, LT for D7 already links the username to their account page (I realise it's not optional) and D7's Bartik theme already has "My account" and "Logout" links which can be copied for theming. There's also a User menu which provides the same functionality in an unordered list, so there are lots of possibilities, and theming would generally take care of the rest.
In short, it's all there if you look for it. As I say, if you'd like this presented neatly in one easy-to-configure point-and-click place then I'll happily have a stab at it!
In conclusion...
Anyway, I just wrote this to make things easier for designers and themers who don't like to touch code. By all means - use it or not. If you have any useful suggestions, I'll have a shot at including them.
(I was going to attach a patch file, but I haven't worked out how to create one yet, and to be honest, drupal.org/patch is no help to me - I figured the people that would benefit from this would, like me, likely not know how to apply a patch anyway - but if I can work it out, or someone else would like to explain/do it then go for it!)
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | block_config.patch | 147.76 KB | ajaysolutions |
| logintoboggan_block_config.zip | 19.36 KB | ajaysolutions |
Comments
Comment #1
ajaysolutions commentedOk, in theory this should work...
(also, I forgot to assign this to myself)
Comment #2
steveparks commentedHi ajaysolutions,
Thanks for contributing this. I understand that non-coders can find the idea of patches difficult, so am willing to review this, and, if it appears to be a useful addition to LT, I'll roll a patch for you that can then continue into the review process, where the main maintainer, hunmonk, can look at it.
I've assigned it to myself for now so I don't lose track of this task.
This'll take a bit of time though, so please be patient.
EDIT: have just realised your follow up comment includes a patch. I'll take a look at that
cheers
Steve
Comment #3
ajaysolutions commentedSteve,
Thank you for your assistance, and I appreciate your time and effort. Hopefully that patch file is fine and correct. For anybody else, those three files that I originally attached should do the trick in the meantime.
Let me know your thoughts when you've had a chance to look things over. I'm looking forward to your feedback.
Cheers!
Al
Ajay Solutions
Comment #4
lal2017 commentedHey is this happening?
These features are simple but actually very useful! Especially for non-coder newbies still learning. I use Drupal 6 and itend to for quite some time until Drupal 7 catches up on all the modules needed for my site. There are others that are having to mess around with theming code to implement these sort of features. (http://drupal.org/node/607026). So to have this included in the module would be great! and appreciated!
Comment #5
hunmonk commentedsorry, features are closed for the 6.x branch, and it sounds like there's no momentum to put these in 7.x.
this is a choice all site admins have to make again and again, tried and true w/ less features, or cutting edge and most likely more maintenance pain...
Comment #6
lal2017 commentedCan we at least please make the Patch available on the module's front page for 6x - provided by Ajaysolutions.
Comment #7
hunmonk commentedno, the patch is readily available here -- the project page is not the place for it.
everybody has their perspective about what's a critical change/feature for a module. i have to balance that against maintaining the module in a way that keeps it stable and doesn't burn me out as a volunteer maintainer.