This patch adds a more link to the block's title bar. See the attached image for an example of a styled more link in a block's title bar.

Only changed one file: plugins/views_plugin_display_block.inc

The patch is rolled against 6.x-2.11 since that's what I'm using right now. I'd be more than happy to roll it against 6.x-3.x-dev but wanted to first get some feedback. New to contributing patches and wanted to make sure I was on the right track.

Thanks to Steven Jones for a similar patch (#614944: Block titles link to somewhere) that helped me figure out how to make the necessary changes.

Related issues:
#235026: More link for blocks
#661714: more link in view block

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

I personally don't believe this will be part of views "core". At least for me this is a quite specific feature request.

There should be some other oppinions about it.

runeveryday’s picture

i hava installed the patch,but it can't work. hope dkingofpa can help me?

Letharion’s picture

If it doesn't belong in views core, perhaps it could find it's way into something like views bonus pack or some such?

runeveryday’s picture

yeah, i also need this,

dkingofpa’s picture

@runeveryday

Currently, I've only tested the patch against Views 6.x-2.11. Make sure you are running that version. It probably works with other versions, but I haven't tested them. Could you provide more info about the problem? Steps to reproduce the issue you're having including how and where you applied the patch, screenshots of the issue, and screenshots of your views block display configuration would all be helpful to provide support.

runeveryday’s picture

got it.thanks dkingofpa ,you're my hero. but now,i want to add a class to the label (more...) .how to add it .thank you,

dkingofpa’s picture

If you absolutely have to add a class for some reason, I'd suggest jQuery. Otherwise, you can just use css to change the look. I may look at adding a views-more-block.tpl.php template in the near future if my current project requires it.

runeveryday’s picture

thanks very much. expect you can do a views-more-block.tpl.php template early.

merlinofchaos’s picture

Status: Needs review » Needs work

As much as I like this idea, I'm really uncomfortable with it, because this ends up putting the more link actually inside your h2 tag, which is totally not semantic. And without some CSS to make it look good, it's going to look utterly horrible.

Unfortunately, this data isn't actually accessible from the block template.

The only thing I can really think to support is to add some additional data to the block structure that is returned from views_block so that themers could easily just add this to the block template, and then provide a tutorial in the advanced help on how to do this.

So I'm going to have to nix this one and hope for what I just suggested instead.

Bevan’s picture

An alternative markup+CSS technique to simplify implementation is to render the more link at the top of the block's $content variable (the view) and use some CSS to bump the link up (approximately aligned horizontally with the title) and vertically-align it to the right-hand side;

E.g. CSS pseudo code:

  .block a.views_more {
    margin-top: -2em;
    text-align: right;
  }

This won't scale well, because every theme has different sizes and margins for block titles and content <div>s, but is a lot easier to implement in views and is still semantic.

runeveryday’s picture

i hope the views can put this function into the next version, in china, lots of website like put the more link after the title. not after all the list's title.

markhalliwell’s picture

Title: Add options for a more link in the block's title bar » Render more links and feed icons in block title
Version: 6.x-2.11 » 7.x-3.x-dev
Status: Needs work » Needs review

I really don't want to create a new issue when this is exactly the issue at hand. I however re-purposed this issue for the 7.x-3.x branch as there hasn't been any discussion in years.

I went ahead and created a sandbox module that overrides the existing block output to move the more links and feed icons into the block title. I am curious though if this should be included in Views core or remain a separate module.

Please let me know what you think:

Views Enhanced Block: http://drupal.org/sandbox/markcarver/1507434

Status: Needs review » Needs work

The last submitted patch, views-block-more-link.patch, failed testing.

markhalliwell’s picture

bump?