Open follow in _blank should be an option in settings. It is simple but major - don't let left our Drupal sites! Please consider this - I know, that we can overraid it, but why not make this module better?

Comments

q0rban’s picture

Status: Active » Closed (won't fix)

Hi! I know this is frustrating, but target="_blank" is not valid html. Please use a module like External module, or override theme_follow_link in your theme.

defconjuan’s picture

See http://drupal.org/node/1271874#comment-7067010 for a solution that does not require the external module or hacking the follow module.

sdmaxey’s picture

Since the target tag has been un-deprecated in html5 and is once again valid html ("The target attribute of the a and area elements is no longer deprecated, as it is useful in Web applications, e.g. in conjunction with iframe." http://www.w3.org/TR/html5-diff/ ), and since the External module still doesn't have a stable version for D7, is it possible to reconsider this request for the Follow module?

sdmaxey’s picture

Issue summary: View changes
Status: Closed (won't fix) » Active
bryanbraun’s picture

Agreed. I support the original decision not to use target="blank" and the interrim solution, but now that it's valid in html5, I think it makes sense to at least have it as an optional setting in the module. My clients expect this functionality when linking to social media profiles, and I doubt I'm alone.

For reference: http://stackoverflow.com/questions/4198788/is-it-alright-use-to-target-b...

Mzambrana’s picture

template.php

/**
 * Theme function to print an individual link.
 *
 * @param $link
 *   A follow link object.
 * @param $title
 *   The translated title of the social network.
 *
 * @ingroup themable
 */
function xxxxxxxxx_follow_link($variables) {
  $link = $variables['link'];
  $title = $variables['title'];
  $classes = array();
  $classes[] = 'follow-link';
  $classes[] = "follow-link-{$link->name}";
  $classes[] = $link->uid ? 'follow-link-user' : 'follow-link-site';
  $attributes = array(
    'class' => $classes,
    'title' => follow_link_title($link->uid) .' '. $title,
    'target' => '_blank',
  );
  $link->options['attributes'] = $attributes;
  return l($title, $link->path, $link->options) . "\n";
}
defconjuan’s picture

@Manel-emfasi thanks for a modified version of the code from comment #2 that's not Bootstrap specific.