Skip to content

Commit 2006c0e

Browse files
authored
Merge pull request #17 from misd-service-development/raven
Allow teasers of type link to not have a link !!!
2 parents 67da834 + b210d58 commit 2006c0e

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

cambridge_teasers.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = Teasers
22
description = Adds University of Cambridge theme teasers node view modes.
33
core = 7.x
44
package = University of Cambridge
5-
version = 7.x-1.5-dev
5+
version = 7.x-1.5
66
project = cambridge_teasers
77
dependencies[] = cambridge_image_styles
88
dependencies[] = features

templates/node----teaser.tpl.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
$content['field_image'][0]['#path'] = array('path' => $url);
1616
endif;
1717
else:
18-
$url = $node_url;
19-
$read_more = t('Read more');
18+
if ($type == 'link'):
19+
$url = NULL;
20+
else:
21+
$url = $node_url;
22+
$read_more = t('Read more');
23+
endif;
2024
endif;
2125

2226
$has_image = isset($content['field_image']);
@@ -41,7 +45,9 @@
4145
<p class="campl-datestamp"><?php print $date; ?></p>
4246
<?php endif; ?>
4347
<?php print render($content); ?>
44-
<a href="<?php print $url; ?>" class="campl-primary-cta"><?php print $read_more; ?></a>
48+
<?php if ($url): ?>
49+
<a href="<?php print $url; ?>" class="campl-primary-cta"><?php print $read_more; ?></a>
50+
<?php endif; ?>
4551
</div>
4652
</div>
4753
</div>

templates/node----vertical-teaser.tpl.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
$content['field_image'][0]['#path'] = array('path' => $url);
1616
endif;
1717
else:
18-
$url = $node_url;
19-
$read_more = t('Read more');
18+
if ($type == 'link'):
19+
$url = NULL;
20+
else:
21+
$url = $node_url;
22+
$read_more = t('Read more');
23+
endif;
2024
endif;
2125

2226
?>
@@ -36,9 +40,10 @@
3640
<p class="campl-datestamp"><?php print $date; ?></p>
3741
<?php endif; ?>
3842
<?php print render($content); ?>
39-
<a href="<?php print $url; ?>" class="campl-primary-cta"><?php print $read_more; ?></a>
43+
<?php if ($url): ?>
44+
<a href="<?php print $url; ?>" class="campl-primary-cta"><?php print $read_more; ?></a>
45+
<?php endif; ?>
4046
</div>
41-
4247
</div>
4348
</div>
4449

0 commit comments

Comments
 (0)