In various issues previously we have mentioned (well Nancy actually had the idea) of providing a customisable
'weblinks_block' node view mode, and generating the block content via node_view()

This change would require a certain amount of re-working of the block configuration options that we currently provide. Some options would become redundant, but others would need extra coding to render the details as we do now.

We should consider:
(a) whether this change is worth doing at all
(b) can/should it be done before we release 7.x-1.0
(c) can it be done quickly ready for 7.x-1.0 with the extra options removed, and then fill in the missing tweaks ready for release 1.1?

I've started work on this and will add a patch for you to try out.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jonathan1055’s picture

Here is a patch which starts off the work. The changes are:

  1. New function weblinks_blocks_entity_info_alter() which creates the customisable view mode
  2. Changes in _weblinks_blocks_content() to get the view mode, use it to create the $items array, then render with drupal_render()
  3. Change to weblinks_blocks_block_configure() to provide a drop-down list of view modes for the admin to choose, and store the value

The basic process is working but the generated content currently has lots of extra items which we do not want, and is missing some items we do want, so it looks pretty messy. However, it is a start, and shows the way we might go forward.

There are other issues currently blocking our 7.x release which may well be solved by this change. We might also consider whether to generate the main page and group page content using another customisable view mode, as there are many issues would be simplified there too. Currently link nodes appear very different when viewing the special /weblinks/popular and weblinks/recent pages compared to a weblinks/x group page.

So, lots to think about.

GStegemann’s picture

Thanks for initiating this issue and your proposals.

Quick answers:
(a) Yes
(b) I propose No.
(c) I would suggest No. I think it is better first to perform a design review and then decide about re-factoring of all the existing block configuration options including a consolidated appearance of the various Web Links pages.

NancyDru’s picture

IMHO:
(a) Yes. It will give the admin more control over the display.
(b) No. 7.x-2.0 maybe. Because it may require adding fields in the module.
(c) No. Take the time to do it right. And what Gerhard said.