Comments

David Stosik’s picture

StatusFileSize
new6.73 KB

"Related modules" block is a different thing, so I won't deal with it here.
I attached a patch removing Resource and Development links sections, and declaring the associated blocks.
What should I do with the Support links section? Create another block?

Edit: beware, the patch attached to this node is wrong, don't use it.

David Stosik’s picture

StatusFileSize
new6.01 KB

Previous patch was wrong.
Here is a good one.

David Stosik’s picture

Status: Active » Needs review
dww’s picture

Status: Needs review » Postponed

I'm not sure always doing this directly in project* makes the most sense. I'd like to step back a bit and figure out how we want to handle these links more generally, instead of automatically trying to change project* to exactly match the MBD prototype. Not every site is going to want this exactly the same way, and I imagine some would rather not mess with blocks for each of these sets of links. Ideally, each project node would be a panel, and it'd be trivial to drag around panes of content (links, download table, description, etc) wherever you want, thought that's obviously a ways off from happening, and might never fly on d.o itself. But, even without that, I think we need a plan before patches like this land.

If we desperately want these as blocks on d.o in the short-term, the best thing would be to use hook_project_page_link_alter() in drupalorg_project.module to hide all the links we don't care about (we already implement this hook there, in fact), and then define whatever d.o-specific blocks we want in drupalorg_project_block(). Feel free to set this back to active and move it to the drupalorg module queue if you want to go that route. Hopefully at DCDC myself and the other project maintainers (and folks working on the redesign) can get together to hash out issues like this.

Thanks,
-Derek

aclight’s picture

It's not obvious to me why we would want to move these links all into blocks, if they are going to be in similar places to where they are now. What advantage does blocks offer? I confess to having little knowledge of theming, especially in D6, but my initial thought is that moving these all to blocks will make it a pain in the ass for sites that continue to want the project* links where they are to keep them there.

Like dww said, it would be great if every project was a panel, but I suspect that this isn't in the cards anytime soon. The proposed solution of using hook_project_page_link_alter() seems like it would work, and wouldn't require changing the project module itself. Maybe that's the best solution until the time that project nodes are panels and can be more easily modified.

dww’s picture

Status: Postponed » Needs work

I caught hunmonk on IRC to hash this out. He's ok with my proposal, which I think will work for everyone's needs.

a) The code in project_project_view() that generates the big $all_links array and invokes drupal_alter() should move into a caching helper function, something like project_get_project_link_info($node).

b) In the array of project links, the top-level arrays that define the section, e.g.:

  $all_links['resources'] = array(
    'name' => t('Resources'),
    'weight' => 4,
  );

should also support a 'type' attribute, something like 'type' => 'block' or 'type' => 'inline'.

c) In hook_view(), we call the helper and look for sections of links that are of type 'inline', and do just what we do now.

d) In hook_block(), we call the helper and look for sections of links that are of type 'block' and expose those as blocks. We'll use the 'name' attribute for the block title, and the array key for the block delta (since that already has to be unique).

At some later date, we can consider an admin UI somewhere to control if each section is a block or inline, but for now, we can just default everything to inline, and drupalorg.module (or any site's custom module) can set specific sections to be blocks if they want to. Certainly the above, plus a small patch to drupalorg.module, is all we need for the d.o redesign sprint this week.

dww’s picture

dww’s picture

Assigned: David Stosik » dww

I'm going to start coding this so we can move forward on the other project blocks.

mfb’s picture

Assigned: dww » mfb
mfb’s picture

StatusFileSize
new10.81 KB

I didn't actually test this but.. here's a patch.

mfb’s picture

Status: Needs work » Needs review
mfb’s picture

StatusFileSize
new11.1 KB

Fix some warnings when $node object not passed to the helper function. also use static var and check view access for the project node.

Note, we are checking node access even if no blocks end up being rendered on the page (could be reversed to find blocks and then check node access).

mfb’s picture

BTW has_issues, view_issues, make_issues could be candidates for helper functions.

dww’s picture

Status: Needs review » Fixed

Rerolled this now that #430484: Remove issue-specific links from project page links landed. Much simpler, now. ;)

Also, added "Project:" to the front of the block admin title so it's easy to see that these are project-related blocks.

Cleaned up some other minor stuff, fixed some comments, etc.

Committed to HEAD. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -drupal.org redesign

Automatically closed -- issue fixed for 2 weeks with no activity.