The existing Slideshow implementation inside page--front.tpl.php template should be converted to another simple and responsive Slideshow implementation.

Comments

gtsopour’s picture

Inside the page--front.tpl.php template, we made the following change regarding the Slideshow implementation. In order to update your existing Slideshow to our latest Slideshow implementation that comes with 7.x-2.x releases, just move your linked image and caption to a new slider-item object as you can see below.

BlueMasters theme comes with a Slideshow implementation hard coded into the page--front.tpl.php. This choice allows you to have a slideshow up and running just after the theme installation. Then you could dig into the source code at page--front.tpl.php template and modify it according to your needs.

BlueMasters gives the option to disable the build in hardcoded Slideshow implementation without dealing with PHP at all. Simple go to BlueMasters theme settings and disable it. So, if you disable the Slideshow (without disabling the -include javascript- option), you can copy/paste the following new Slideshow code inside a Drupal System block. Finally, just place this new block to the Banner region and you will be able to configure this block through Drupal's User Interface.

Changed from

<div class="main_view">
    <div class="window">
        <div class="image_reel">
            <a href="<?php print url('node/3'); ?>"><img src="<?php print base_path() . drupal_get_path('theme', 'bluemasters') . '/images/slide-image-3.jpg'; ?>"></a>
            <a href="<?php print url('node/2'); ?>"><img src="<?php print base_path() . drupal_get_path('theme', 'bluemasters') . '/images/slide-image-2.jpg'; ?>"></a>
            <a href="<?php print url('node/1'); ?>"><img src="<?php print base_path() . drupal_get_path('theme', 'bluemasters') . '/images/slide-image-1.jpg'; ?>"></a>
        </div>
        <div class="descriptions">
            <div class="desc" style="display: none;">About Bluemasters</div>
            <div class="desc" style="display: none;">Our Portfolio</div>
            <div class="desc" style="display: none;">Creation of Beaches</div>
        </div>
    </div>

    <div class="paging">
        <a rel="1" href="#">1</a>
        <a rel="2" href="#">2</a>
        <a rel="3" href="#">3</a>
    </div>
</div>

To

<!--#slideshow-->
<div id="slideshow">

<div class="flexslider">
<ul class="slides">

<!-- slider-item -->
<li class="slider-item">
<div class="slider-item-image">
<a href="<?php print url('node/3'); ?>"><img src="<?php print base_path() . drupal_get_path('theme', 'bluemasters') . '/images/slide-image-3.jpg'; ?>"></a>
</div>
<div class="slider-item-caption">About Bluemasters</div>
</li>
<!-- EOF: slider-item -->

<!-- slider-item -->
<li class="slider-item">
<div class="slider-item-image">
<a href="<?php print url('node/2'); ?>"><img src="<?php print base_path() . drupal_get_path('theme', 'bluemasters') . '/images/slide-image-2.jpg'; ?>"></a>
</div>
<div class="slider-item-caption">Our Portfolio</div>
</li>
<!-- EOF: slider-item -->

<!-- slider-item -->
<li class="slider-item">
<div class="slider-item-image">
<a href="<?php print url('node/1'); ?>"><img src="<?php print base_path() . drupal_get_path('theme', 'bluemasters') . '/images/slide-image-1.jpg'; ?>"></a>
</div>
<div class="slider-item-caption">Creation of Beaches</div>
</li>
<!-- EOF: slider-item -->

</ul>
</div>

</div>
<!--EOF:#slideshow-->
curious-trick’s picture

Thanks for posting this. The block method doesn't work for me because Drupal (or maybe CKEditor?) automatically removes the class items from all the tags. So, when I put in <div class="slider-item-image">, it gets turned into <div>, and I'm guessing that this is why the slideshow doesn't show up on my page. I'm sure there's an answer somewhere in Drupal documentation about text filters and HTML profiles, but I don't know where to find it or how to fix this. Thanks.

curious-trick’s picture

Issue summary: View changes

Simple text

scotwith1t’s picture

This can also be done fairly easily using a view and, in fact, if I can find time one day, I'd love to contribute this back to the theme. But basically:

  • Simple Content Type: Slideshow Image
  • Fields: Image (make image preset to whatever size, but i did mine to 930x320 like the default theme images), just the title and I used the link module to add a link but you could easily just use a text field
  • Create a couple pieces of content (or use devel generate to speed things up!)
  • Create a block view, set up as follows:
    • Include title (not linked), image (with right preset) and link (absolute URL is what I used)
    • HTML list style. IMPORTANT: set the HTML settings to have a Row Class of slider-item, Wrapper Class = flexslider and List Class = slides
    • Not sure if this is critical or not, but just to remove the cruft, anywhere I could remove views row classes on each field and such, i did.
    • I did mine with title and link excluded from view, on image field rewrite contents as such:
<div class="slider-item-image">
  <a href="[field_slideshow_link]">
    [field_slideshow_image]
  </a>
</div>
<div class="slider-item-caption"><a href="[field_slideshow_link]">[title]</a></div>

Of course, this means you would need to remove the markup in page--front.tpl.php inside div#slideshow. i then moved the banner region inside here like this, then assigned the block created by my view to the banner region. You may also want to remove the

<?php if (theme_get_setting('slideshow_display','bluemasters')): ?>

at that point so it's not dependent on whether the "Show Slideshow" is configured in the theme or not. I also removed the #banner wrapper as it doesn't seem to do anything at this point. so i end up with just this between the header and main content

<div class="container_12">
  <div class="grid_12">
    <div id="slideshow">                
      <?php print render($page['banner']); ?>
    </div>
  </div>    
</div>

Hope that helps someone. :) Nice theme. Thx.

drewkeller’s picture

Issue summary: View changes

@scott, thanks for posting, that helped me, although I did mine a bit differently. For some reason, after disabling and then re-enabling my old blue masters theme (with views) made it forget my rotated images.

One thing to note (maybe just for those of us who only mess around in drupal occasionally)... are the machine names of the view and the display in that view. In the code below, the name of my view is "rotation_image" and the name of the display is "banner". I didn't end up using the rewrite options in the view.

Maybe this is a little different in 7.x-2.1, which I'm using.

			<?php $block = module_invoke('views', 'block_view', 'rotation_image-banner');
				print render($block);
			?>
mfuller526’s picture

I had to enable the PHP filter module otherwise my php code was changed.

<?php and ?> become &lt;?php and &gt;?php when I view source in my browser. But now the classes are removed from the <ul> and <li> tags. How do I solve this? Thanks.

Example code in block:

<div id="slideshow">
<div class="flexslider">
<ul class="slides">
<!-- slider-item -->
<li class="slider-item">
<div class="slider-item-image">
<a href="<?php print url('content/about-us'); ?>"><img src="<?php print base_path() . drupal_get_path('theme', 'bluemasters') . '/images/melody930_320_5.jpg'; ?>"></a>
</div>
<div class="slider-item-caption">About Us</div>
</li>
<!-- EOF: slider-item -->
realskorpion’s picture

I have an issue.

After updating to 7.x-2.x, the slideshow doesn't loop and clicking the dots to select a specific slide doesn't work.
Any ideas about what's happening?

Thanks

realskorpion’s picture

If found the solution to my problem: https://www.drupal.org/node/2311487

Thanks

plato1123’s picture

Any tips if I'm making my own Flexslider but want to use the styling of the built in one? I see a lot of Flexslider related CSS and am not sure if I need all of it and/or need to add classes to my flexslider block view. Thanks to anyone that can help!

djsagar’s picture

Status: Active » Needs review

HI,

bluemasters released 7.x-2.x Version, which have responsive Slideshow and it's working fine you can check your self.

Thanks!

djsagar’s picture

Assigned: gtsopour » Unassigned
gaurav.kapoor’s picture

Status: Needs review » Closed (works as designed)