Skip to content

Commit eaba9ba

Browse files
committed
Issue #2, #3 - changes to support Falcon migrations, optional link and title caption.
1 parent 4c52512 commit eaba9ba

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@ Changelog for 7.x-1.*
77
5 November 2013.
88

99
* Initial release.
10+
11+
7.x-1.1
12+
-------
13+
14+
4 September 2018
15+
16+
* Add ability to hide the title caption
17+
* Allow carousels (of type 'homepage_carousel') to not link to anything

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ For each content type you will need to set the display settings for Carousel as
99

1010
If you are using a `field_link` provided by the [Link feature](https://github.com/misd-service-development/drupal-feature-link) you also need to make your link field available (it doesn't matter what format setting you use). The carousel item will then link to your custom URL rather than to the node.
1111

12+
If your content type is of type 'homepage_carousel' then the carousel item will not link to the node (But may link to a custom URL using the {Link Feature] as above.
13+
14+
If your node has a field 'field_hide_title' and this field is set to true, then the title caption will not be output.
15+
1216
Creating carousels
1317
------------------
1418

cambridge_carousel.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = Carousel
22
description = Adds a carousel item node view mode.
33
core = 7.x
44
package = University of Cambridge
5-
version = 7.x-1.1-dev
5+
version = 7.x-1.1
66
project = cambridge_carousel
77
dependencies[] = cambridge_image_styles
88
features[ctools][] = views:views_default:3.0

templates/node----carousel-item.tpl.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
if (array_key_exists('field_link', $content)):
44
$url = $content['field_link']['#items'][0]['url'];
55
else:
6-
$url = $node_url;
6+
$url = ($type == 'homepage_carousel') ? NULL : $node_url;
77
endif;
88

99
if (!isset($content['field_image'][0]['#path']['path'])) {
@@ -17,6 +17,19 @@
1717
<div class="image-container">
1818
<?php print render($content['field_image']); ?>
1919
</div>
20+
21+
<?php if( !(isset($content['field_hide_title']['#items']) && ($content['field_hide_title']['#items'][0]['value']))): ?>
2022
<div class="campl-slide-caption">
21-
<a href="<?php print $url; ?>"><span class="campl-slide-caption-txt"><?php print $title; ?></span></a>
23+
24+
<?php if($url) : ?>
25+
<a href="<?php print $url; ?>">
26+
<?php endif; ?>
27+
28+
<span class="campl-slide-caption-txt"><?php print $title; ?></span>
29+
30+
<?php if($url) : ?>
31+
</a>
32+
<?php endif; ?>
33+
2234
</div>
35+
<?php endif; ?>

0 commit comments

Comments
 (0)