Hello

Would it be possible to extend the functionality of this really wonderful module, in order to support CSS? I would really like to change the way links appear, so that I can have different link colors between the links section and the rest of the site.
I know that I can manage it if I work with classes through the main theming CSS style, but it would be more flexible if there was another CSS file for only Web Links module.

Thanks alot!

CommentFileSizeAuthor
#15 weblinks11.patch13.59 KBnancydru

Comments

ideaoforder’s picture

This is a great suggestion! I'll work on adding it to the next revision.

rmiddle’s picture

Version: 5.x-1.5 » master
Assigned: Unassigned » rmiddle

Need to look into this.

Thanks
Robert

nancydru’s picture

Robert: would you like me to tackle this one?

rmiddle’s picture

NancyDru,

Anything you want to work on feel free. I only care the works get done not who does it. The more you do the less I have to do. :)

Thanks
Robert

nancydru’s picture

I know the feeling. With 18 contribs of my own, I'll take any help I can get. I just happen to have a site that needs WL right now, so I'm actively thinking about it.

rmiddle’s picture

Title: Theming » Update themeing to include custom CSS support.
nancydru’s picture

Assigned: rmiddle » nancydru

I am actively working on this.

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

@Ldectus_gr: are you still looking for this? Are you using the 6.x version?

vangelisp’s picture

Hi again! I'm still using the 5.x version (modified with collapsible fields) and currently I'm happy with it.
But to tell you the truth, it would still be a nice feature to add. Of course IF this doesn't require lots and lots of developing time to be done, otherwise, I'm not sure if it's worth the hussle.

How are you proceeding on this ? Coloring through CSS or through the Web-UI per category or link ?

PS. Here's the weblinks 5.x (I don't remember which version) in action: http://www.motoridersclub.com/en/weblinks

Thanks !

nancydru’s picture

Okay, I'm working in the 6.x version because I don't currently use it on any 5.x sites (although that's likely to change now). I'm trying to get this part done before I go back and tackle the fieldsets (which both Robert and I would like to see). It would be nice if you could do a proper patch in that other issue to make it easier to see what you did.

The page description gets a new theme function as well as its own CSS class. Likewise, the authoring information has a new theme function, proper translatability, and its own class.

Right now, the main part of each link is still not themed, although I would like to change that (one step at a time). However, I am adding a new class to the UL tag, so that each category can be formatted differently, if desired. The individual links get two new classes. The first is just a generic "weblinks-item." The second is "weblinks-link-nid" so that even individual links can be formatted separately.

With some of the clean up that I've done, I would expect someone with a larger number of links will also see a performance boost on the links page.

rmiddle’s picture

I am so looking forward to that patch.

Thanks
Robert

nancydru’s picture

Status: Postponed (maintainer needs more info) » Needs review

Robert, since I don't have CVS access, I need a new file added before the patch. This is "weblinks.css"

/* $Id: $ */
/**
 * @file
 *   Style sheet for the Weblinks module.
 */

.weblinks-pagedesc {
  display: block;
  border: 1px ridge black;
  text-align: center;
}

.weblinks-info {
  font-style: italic;
  font-size: 89%;
  margin-left: 2em;
}
rmiddle’s picture

Ok added to CVS.

nancydru’s picture

Here's the first cut at the whole thing. (Sorry, I have customers breathing down my neck and they pay more than you do.)

This patch does a bit more than the original intent, I hope you don't mind my throwing a few other things in.

  1. Adds a starter CSS file.
  2. Adds a return from the settings page (overlooked in the patch that added this).
  3. Adds the new theme functions and hook_theme entries (don't forget to rebuild your theme_registry).
  4. Changes the page description to a themed function.
  5. Changes the info line to a themed function.
  6. Moves a few variable_get and user_access functions outside the main loop (performance).
  7. Adds a new class to the UL tag using the tid.
  8. Adds a class to the LI tag using the nid.
  9. Adds a generic class to the LI tag.
  10. Changes the description filtering to use the node's input format.
  11. Changes the info date formatting to use the site admin's setting.
  12. Adds the sort ordering request (http://drupal.org/node/178189).
  13. Capitalizes the "list" overview menu tab.
  14. Fixes a "bdragon: no, no, no" comment in the block.
  15. Fixes a few places where "target=_blank" was incorrect.
  16. Changes various double quote uses to single quotes (performance and readability).
  17. Minor comment clean up (Drupal standards).

Whew!

There is a bit of code commented out from a quick initial test to use Image Attach. I would appreciate leaving it in place for now.

I still want to do some more work in this area before we move on to collapsible fieldsets.

nancydru’s picture

StatusFileSize
new13.59 KB

Well, I suppose the actual patch would help.

nancydru’s picture

I will refresh my working code after you review this

rmiddle’s picture

Nancy for the most part it looks good except no theme_weblinks_node_view is included? It is defined but not included?

Thanks
Robert

PS. Dang this is going to be fun to back port to 5.

rmiddle’s picture

Status: Needs review » Needs work
nancydru’s picture

Actually back porting shouldn't be a big deal, other than just the manual effort to integrate the whole thing. I even did the themes so that they should work in 5.x.

Hmm, how could I have lost the template?

nancydru’s picture

Hmm, it's there in my code; I didn't even touch that area. I didn't use it in my new code.

rmiddle’s picture

Nancy,

The rest of the patch looks good. I will commit once I have the template. file. I also want to reweight the form a little when viewing the node the url should be above the title not below. But that has nothing to do with you patch.

Thanks
Robert

rmiddle’s picture

Nancy,

I am losing it that is the tpl.php file already there.

I need more coffee this morning I think.

Robert

rmiddle’s picture

Status: Needs work » Reviewed & tested by the community
nancydru’s picture

Hee, hee. I'm on my 5th cup.

rmiddle’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Ok that patch is committed.

Thanks
Robert

nancydru’s picture

Oh, shoot.

I'll have to one more little one to fix HTML entities caused by check_plain...

rmiddle’s picture

Nancy,

That is cool. I also copied your SQL changes for sort order over to the block display but I am thinking that I should make that a diff option? What are your though on that?

Thanks
Robert

nancydru’s picture

Yes, I looked at that briefly. It probably should be changed, but I haven't carefully studied it to see what makes sense. Maybe I should enable the blocks to get an idea if what it actually does. ;-)

It may also make sense to add a "more..." link.

rmiddle’s picture

Yea a "more..." Link makes since. I personally only use the blocks. That is why alpha1 was released with /weblink not working. I never noticed it wasn't working in the months that I was running the pre alpha1 code on my site. Although once we have the collapsible fieldsets included I might actually use that feature they looked cool.

Thanks
Robert

nancydru’s picture

Robert, I just downloaded alpha8 and it looks like you added the CSS file, but maybe didn't commit it?
Never mind, I see alpha8 was done before that. I'll wait for the -dev to roll up, I guess.

rmiddle’s picture

alpha8 was to fix the mistake in alpha6 that I though was in alpha7. I try not to do update more then every few days. There are already a few people who aren't happy with my every few day release process I have been doing already.

Thanks
Robert

rmiddle’s picture

Nancy,

I just committed a really cool update. I merged all the query code into 1 function. I added a new case to support most recent as used in recent_block and now all that code is in one place.

Thanks
Robert

nancydru’s picture

Sounds great. As soon as the -dev version rolls up, I'll download it.

Yes, maybe it is time to slow down a bit on the releases. But then they will complain that they don't like -dev versions... On my modules I try not to do a new version more than once a month, but sometimes you feel like you really have no choice.

rmiddle’s picture

I go though the same pattern. I take over a project I clean up the queue do a bunch of updates really close together. Start to realize how many updates are going though start to slow down on the releases and then once things start to get clean releases return to normal. Then repeat with next project. I need to stop that patten before I fall over from work.

Thanks
Robert

rmiddle’s picture

Status: Postponed (maintainer needs more info) » Patch (to be ported)
rmiddle’s picture

Status: Patch (to be ported) » Fixed

Committed to D5 CVS.

nancydru’s picture

Status: Fixed » Closed (fixed)