-
-
Save anonymous/3ab33015f5fe0fc113a6 to your computer and use it in GitHub Desktop.
Tile Plus Image
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 if ( $atts['show_image'] ) { ?> | |
<div style="float: left; margin-right: 10px;"> | |
<?php // ADDED TO WRAP IMAGES WITH URL | |
$anchor = cnURL::permalink( array( | |
'type' => $atts['target'], | |
'slug' => $entry->getSlug(), | |
'title' => $entry->getName( $atts ), | |
'text' => $out, | |
'home_id' => $entry->directoryHome['page_id'], | |
'force_home' => $entry->directoryHome['force_home'], | |
'return' => TRUE, | |
) | |
); | |
preg_match( '/href="(.*?)"/', $anchor, $matches ); | |
$url = $matches[1]; ?> | |
<a target=_blank href="<?php echo $url ?>"> | |
<?php | |
$entry->getImage( array( | |
'image' => $atts['image'] , | |
'height' => $atts['image_height'] , | |
'width' => $atts['image_width'] , | |
'fallback' => array( | |
'type' => $atts['image_fallback'] , | |
'string' => $atts['str_image'] | |
) | |
) | |
); | |
?> | |
</a> | |
</div> | |
<?php } ?> |
Update to use the new helper method introduced in Connections 8.1.6...
<?php if ( $atts['show_image'] ) : ?>
<div style="float: left; margin-right: 10px;">
<a target=_blank href="<?php echo $entry->getPermalink(); ?>">
<?php $entry->getImage(
array(
'image' => $atts['image'] ,
'height' => $atts['image_height'] ,
'width' => $atts['image_width'] ,
'fallback' => array(
'type' => $atts['image_fallback'] ,
'string' => $atts['str_image']
)
)
); ?>
</a>
</div>
<?php endif; ?>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I did have two typos ... darn you copy/paste!
here's the correct code!