Skip to content

Instantly share code, notes, and snippets.

@steffenr
Created July 10, 2012 05:57
Show Gist options
  • Save steffenr/3081444 to your computer and use it in GitHub Desktop.
Save steffenr/3081444 to your computer and use it in GitHub Desktop.
extend drupal business theme to 5 slides (used subtheme)
name = Business Subtheme
description = business subtheme
version = VERSION
core = 7.x
base theme = business
regions[sidebar_first] = First Sidebar
regions[header] = Header
regions[homequotes] = Home Quotes
regions[home_high1] = Home Highlight 1
regions[home_high2] = Home Highlight 2
regions[home_high3] = Home Highlight 3
regions[content] = Content
regions[content_top] = Content Top
regions[help] = Help
regions[footer_first] = First Bottom
regions[footer_second] = Second Bottom
regions[footer_third] = Third Bottom
regions[footer_fourth] = Fourth Bottom
regions[footer] = Footer
<?php if (theme_get_setting('slideshow_display','business')): ?>
<?php
$url1 = theme_get_setting('slide1_url','business');
$url2 = theme_get_setting('slide2_url','business');
$url3 = theme_get_setting('slide3_url','business');
$url4 = theme_get_setting('slide4_url','mybusinesssubtheme');
$url5 = theme_get_setting('slide5_url','mybusinesssubtheme');
?>
<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-3.jpg'; ?>"></a>
<a href="<?php print url($url2); ?>"><img src="<?php print base_path() . drupal_get_path('theme', 'business') . '/images/slide-image-2.jpg'; ?>"></a>
<a href="<?php print url($url3); ?>"><img src="<?php print base_path() . drupal_get_path('theme', 'business') . '/images/slide-image-1.jpg'; ?>"></a>
<a href="<?php print url($url4); ?>"><img src="<?php print base_path() . drupal_get_path('theme', 'mybusinesssubtheme') . '/images/slide-image-4.jpg'; ?>"></a>
<a href="<?php print url($url5); ?>"><img src="<?php print base_path() . drupal_get_path('theme', 'mybusinesssubtheme') . '/images/slide-image-5.jpg'; ?>"></a>
</div>
<div class="descriptions">
<div class="desc" style="display: none;"><?php print theme_get_setting('slide1_desc','business'); ?></div>
<div class="desc" style="display: none;"><?php print theme_get_setting('slide2_desc','business'); ?></div>
<div class="desc" style="display: none;"><?php print theme_get_setting('slide3_desc','business'); ?></div>
<div class="desc" style="display: none;"><?php print theme_get_setting('slide4_desc','mybusinesssubtheme'); ?></div>
<div class="desc" style="display: none;"><?php print theme_get_setting('slide5_desc','mybusinesssubtheme'); ?></div>
</div>
</div>
<div class="paging">
<a rel="1" href="#">1</a>
<a rel="2" href="#">2</a>
<a rel="3" href="#">3</a>
<a rel="4" href="#">4</a>
<a rel="5" href="#">5</a>
</div>
</div>
</div><!-- EOF: #banner -->
<?php
function mybusinesssubtheme_form_system_theme_settings_alter(&$form, &$form_state) {
$form['busi_settings']['slideshow']['slide4'] = array(
'#type' => 'fieldset',
'#title' => t('Slide 4'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['busi_settings']['slideshow']['slide4']['slide4_desc'] = array(
'#type' => 'textfield',
'#title' => t('Slide Description'),
'#default_value' => theme_get_setting('slide4_desc','mybusinesssubtheme'),
);
$form['busi_settings']['slideshow']['slide4']['slide4_url'] = array(
'#type' => 'textfield',
'#title' => t('Slide URL'),
'#default_value' => theme_get_setting('slide4_url','mybusinesssubtheme'),
);
$form['busi_settings']['slideshow']['slide5'] = array(
'#type' => 'fieldset',
'#title' => t('Slide 5'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['busi_settings']['slideshow']['slide5']['slide5_desc'] = array(
'#type' => 'textfield',
'#title' => t('Slide Description'),
'#default_value' => theme_get_setting('slide5_desc','mybusinesssubtheme'),
);
$form['busi_settings']['slideshow']['slide5']['slide5_url'] = array(
'#type' => 'textfield',
'#title' => t('Slide URL'),
'#default_value' => theme_get_setting('slide5_url','mybusinesssubtheme'),
);
}
?>
@ivaylospasov
Copy link

Hi, is there a variant this slider to work in multilingual website. How to make different slides to show on different languages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment