Skip to content
This repository has been archived by the owner on Mar 25, 2019. It is now read-only.

issue #798: Добавить target=_blank для ссылок на компании #802

Merged
merged 1 commit into from Nov 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion profiles/drupalru/modules/marketplace/marketplace.module
Expand Up @@ -316,7 +316,10 @@ function marketplace_view($node, $view_mode, $langcode = NULL) {
$website = 'http://' . $website;
}
$node->content['website'] = array(
'#markup' => l($node->website, $website, array('attributes' => array('rel' => 'nofollow'))),
'#markup' => l($node->website, $website, array('attributes' => array(
'rel' => 'nofollow',
'target' => '_blank',
))),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Просто для вашего знания: можно делать не #makup => l(), а

$node->content['website'] = array(
  '#theme'   => 'link',
  '#text'    => $node->website,
  '#path'    => $website,
  '#options' => array(
    'attributes' => array(
      'rel'    => 'nofollow',
      'target' => '_blank',
    ),
  ),
);

На мой взгляд, так симпатичнее. Но это просто на будущее.

'#weight' => 1,
);

Expand Down