Created
June 25, 2014 18:32
-
-
Save intergalactic-overlords/e7ff832451e5fc8adc9c to your computer and use it in GitHub Desktop.
Drupal 7 DS 1 column completely clickable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
folder ds_layouts | |
> folder ds_1col_linked | |
> file ds-1col-linked.tpl.php | |
> file ds_1col_linked.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Linked 1 column template. | |
*/ | |
?> | |
<?php | |
// is it a node or a taxonomy term? | |
$link = ''; | |
if (isset($variables['node_url'])) { | |
$link = $variables['node_url']; | |
} else if (isset($variables['vocabulary_machine_name'])) { | |
$link = url('taxonomy/term/' . $variables['tid']); | |
} | |
?> | |
<<?php print $ds_content_wrapper; print $layout_attributes; ?> class="1col-linked <?php print $classes;?> clearfix"> | |
<?php if (isset($title_suffix['contextual_links'])): ?> | |
<?php print render($title_suffix['contextual_links']); ?> | |
<?php endif; ?> | |
<?php if (!empty($link)): ?> | |
<a class="wrap-link" href="<?php print $link; ?>"> | |
<?php endif; ?> | |
<?php print $ds_content; ?> | |
<?php if (!empty($link)): ?> | |
</a> | |
<?php endif; ?> | |
</<?php print $ds_content_wrapper ?>> | |
<?php if (!empty($drupal_render_children)): ?> | |
<?php print $drupal_render_children ?> | |
<?php endif; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ds_1col_linked() { | |
return array( | |
'label' => t('One column linked'), | |
'regions' => array( | |
'ds_content' => t('Content'), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment