0

I have the business drupal theme aplied on a test site, in this theme u have a slideshow on the front page. I wanted to display it on every page so I copied following code to page-tl.php

    <?php if (theme_get_setting('slideshow_display','business')): ?>
    <?php 
    $url1 = check_plain(theme_get_setting('slide1_url','business'));
    $url2 = check_plain(theme_get_setting('slide2_url','business'));
    $url3 = check_plain(theme_get_setting('slide3_url','business'));
    ?>
      <div id="slider">
        <div class="main_view">
            <div class="window">
                <div class="image_reel">
                    <a href="<?php print url($url1); ?>"><img src="<?php print 

base_path() . drupal_get_path('theme', 'business') . '/images/slide-image-4.jpg'; ?

>"></a>
                    <a href="<?php print url($url2); ?>"><img src="<?php print 

base_path() . drupal_get_path('theme', 'business') . '/images/slide-image-5.jpg'; ?

>"></a>
                    <a href="<?php print url($url3); ?>"><img src="<?php print 

base_path() . drupal_get_path('theme', 'business') . '/images/slide-image-6.jpg'; ?

>"></a>
                </div>
                <div class="descriptions">
                    <div class="desc" style="display: none;"><?php print check_markup

(theme_get_setting('slide1_desc','business')); ?></div>
                    <div class="desc" style="display: none;"><?php print check_markup

(theme_get_setting('slide2_desc','business')); ?></div>
                    <div class="desc" style="display: none;"><?php print check_markup

(theme_get_setting('slide3_desc','business')); ?></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>
      </div><!-- EOF: #banner -->
    <?php endif; ?>



  <?php print $messages; ?>

  <?php if ($page['homequotes']): ?>
  <div id="home-quote"> <?php print render($page['homequotes']); ?></div>
  <?php endif; ?>

  <?php if ($page['home_high1'] || $page['home_high2'] || $page['home_high3']): ?>
    <div id="home-highlights" class="clearfix">
     <?php if ($page['home_high1']): ?>
     <div class="home-highlight-box"><?php print render($page['home_high1']); ?></div>
     <?php endif; ?>
     <?php if ($page['home_high2']): ?>
     <div class="home-highlight-box"><?php print render($page['home_high2']); ?></div>
     <?php endif; ?>
     <?php if ($page['home_high3']): ?>
     <div class="home-highlight-box remove-margin"><?php print render($page

['home_high3']); ?></div>
     <?php endif; ?>
    </div>
  <?php endif; ?>

Now the sliding effect is gone (except on the front page), so I thought that there was missing javascript. However I can't find a solution...

U can see the problem on Click for problem here

0

You should also include the javascript files on every page instead of only on the front page.

If you look at the template.php file in the theme folder, at the end of the file:

/**
 * Add javascript files for front-page jquery slideshow.
 */
if (drupal_is_front_page()) {
  drupal_add_js(drupal_get_path('theme', 'business') . '/js/sliding_effect.js');
}

You should remove the if statement to make it load on every page:

/**
 * Add javascript files for front-page jquery slideshow.
 */
drupal_add_js(drupal_get_path('theme', 'business') . '/js/sliding_effect.js');
|improve this answer|||||
0

You may have to review your code, your sliding effects javascript file is missing from your other pages except for the front page.

<script type="text/javascript" src="http://karelmaes.stijnaerts.be/sites/all/themes/business/js/sliding_effect.js?n8jrx6"></script>

Above missing.

You can check this out for more information Adding Javascript to themes

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.