Skip to content

Commit

Permalink
Issue #2, #3 - changes to support Falcon migrations, optional link an…
Browse files Browse the repository at this point in the history
…d title caption.
  • Loading branch information
timdavison committed Sep 4, 2018
1 parent 4c52512 commit eaba9ba
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ Changelog for 7.x-1.*
5 November 2013.

* Initial release.

7.x-1.1
-------

4 September 2018

* Add ability to hide the title caption
* Allow carousels (of type 'homepage_carousel') to not link to anything
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ For each content type you will need to set the display settings for Carousel as

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.

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.

If your node has a field 'field_hide_title' and this field is set to true, then the title caption will not be output.

Creating carousels
------------------

Expand Down
2 changes: 1 addition & 1 deletion cambridge_carousel.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = Carousel
description = Adds a carousel item node view mode.
core = 7.x
package = University of Cambridge
version = 7.x-1.1-dev
version = 7.x-1.1
project = cambridge_carousel
dependencies[] = cambridge_image_styles
features[ctools][] = views:views_default:3.0
Expand Down
17 changes: 15 additions & 2 deletions templates/node----carousel-item.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if (array_key_exists('field_link', $content)):
$url = $content['field_link']['#items'][0]['url'];
else:
$url = $node_url;
$url = ($type == 'homepage_carousel') ? NULL : $node_url;
endif;

if (!isset($content['field_image'][0]['#path']['path'])) {
Expand All @@ -17,6 +17,19 @@
<div class="image-container">
<?php print render($content['field_image']); ?>
</div>

<?php if( !(isset($content['field_hide_title']['#items']) && ($content['field_hide_title']['#items'][0]['value']))): ?>
<div class="campl-slide-caption">
<a href="<?php print $url; ?>"><span class="campl-slide-caption-txt"><?php print $title; ?></span></a>

<?php if($url) : ?>
<a href="<?php print $url; ?>">
<?php endif; ?>

<span class="campl-slide-caption-txt"><?php print $title; ?></span>

<?php if($url) : ?>
</a>
<?php endif; ?>

</div>
<?php endif; ?>

0 comments on commit eaba9ba

Please sign in to comment.