Each block calls outbody_of_block(), which prepares and returns HTML.
Changing this to a theme function will allow themers to override the module's default HTML, giving more control over the presentation. Moving the SQL to a template preprocess call allows better separation of markup from logic.

Patch attached is against HEAD.

CommentFileSizeAuthor
content_slider_use_theme_layer.patch7.08 KBmanarth

Comments

Rosamunda’s picture

Hello there!
I´m trying to apply your patch, but it seems that tortoise won´t let me do it.
I´ve checked the patch out, and found that the file content_slider.tpl.php doesn´t exist...

manarth’s picture

Hi Rosamunda,

The file content_slider.tpl.php doesn't exist in the original module; it's a new file (and *should* be created as part of the patch). I guess Tortoise might have issues trying to apply a standard linux-format patch...There are instructions on applying patches for Windows users here: http://drupal.org/node/32627

If you run into probs, here are the contents of the two files:

content_slider.tpl.php

<div id="slider<?php echo $delta; ?>" class="sliderwrapper">
  <?php foreach($rows as $row): ?>
    <?php echo $row; ?>
  <?php endforeach; ?>
</div>

<div id="paginate-slider<?php echo $delta; ?>" class="pagination"></div>

<script type="text/javascript">
  featuredcontentslider.init({
    id: "slider<?php echo $delta; ?>",           //id of main slider DIV'
    contentsource: ["inline", ""],               //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
    toc: "#increment",                           //Valid values: "#increment", "markup", ["label1", "label2", etc]
    nextprev: ["Previous", "Next"],              //labels for "prev" and "next" links. Set to "" to hide
    revealtype: "click",                         //Behavior of pagination links to reveal the slides: "click" or "mouseover"
    enablefade: [true, 0.2],                     //[true/false, fadedegree]
    autorotate: [true, 3000],                    //[true/false, pausetime]
    onChange: function(previndex, curindex){     //event handler fired whenever script changes slide
      //previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
      //curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
    }
  })
</script>

content_slider_row.tpl.php

<div class="contentdiv">
<a href="<?php echo $base_url; ?>/node/<?php echo $slider_nid; ?>"><?php echo $content; ?></a>
<?php if ($slider_nid == 1): ?>
  <p></p><a href="javascript:featuredcontentslider.jumpTo(slider1, 3)">
<?php endif; ?>
</div>
Rosamunda’s picture

MANY, MANY THANKS MARCUS!

mixman’s picture

Thanks for the patch.

Why isn't this in the repo?
It's a simple, but also a VERY needed functionality.

manarth’s picture

mixman: I believe this module is abandoned - the auther contributed a number of modules/themes over a year ago, but hasn't committed to any of them for at least a year.

I'll kick off Drupal's abandoned module procedure: http://drupal.org/node/251466

sudeepg’s picture

Status: Needs review » Closed (fixed)

Fixed in the latest release.

-- Sudeep