Skip to content

Issue #2, #3 - changes to support Falcon migrations, optional link an… #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Issue #2, #3 - changes to support Falcon migrations, optional link an…
…d title caption.
  • Loading branch information
timdavison committed Sep 4, 2018
commit eaba9ba488529ae9ed165eaeac9c447e71e5d73a
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; ?>