My personal goal with this change is to hide the Project_Release_Downloads_Table in the project node rendering. I use the Project Release module for Issue Tracking but I am not wanting to publish a downloads table for each project. I attempted to fix this in CSS but there is no container or containers that allow me target the downloads table. I modified the project_release_node_view() hook to add a

element with a class of "project_release_downloads" using #prefix and #suffix elements.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mattreba’s picture

hass’s picture

Status: Active » Needs review
dww’s picture

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

In this case, wouldn't it be better to use a template preprocess function to just clobber $node->content['project_release_downloads'] instead of wrapping it in a div and then hiding that via CSS?

I'm not fundamentally opposed to adding a div, but a) it seems a bit like markup bloat in the common case and b) seems pointless to include all that markup and then hide it in this case.

Thoughts?

Thanks,
-Derek

drumm’s picture

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

project_release should be smarter and not add the heading if there isn't content. display: none should be a last resort, it is much better to not send the markup in the first place.

dww’s picture

Also true. ;) It's somewhat smart already, and only shows the table on projects that are configured to want releases. But it's not checking to make sure there *are* releases to display. Agree the header shouldn't show in that case. However, I think that's a separate bug since I think mattreba's talking about the case that there are releases, but he just doesn't want to display them on project nodes like we do.