Blog posts slider - any ideas ?

Topics: Administration, Customizing Orchard, Writing modules
May 21, 2013 at 10:55 AM
Hello everyone,

Is there any possibility to make slider with blog posts in easy way ? (image + some text)
I have tried Featured Item Slider - great extension, but it show only content type called Featured Items, so when we adding 'blog post', we must add a 'feature item' too.
Developer
May 21, 2013 at 11:07 AM
If Featured Items has a content part that is responsible for rendering the slideshow, you could attach that part to the BlogPost type.
May 21, 2013 at 11:31 AM
Edited Jun 5, 2013 at 5:42 PM
iskrzycki wrote:
Hello everyone,

Is there any possibility to make slider with blog posts in easy way ? (image + some text)
I have tried Featured Item Slider - great extension, but it show only content type called Featured Items, so when we adding 'blog post', we must add a 'feature item' too.
I added a bit more for Featured Item Slider so when the content type was updated it would update its relevant 'featured item'
I wish I had made it an extension module rather than updating the module now.

https://skydrive.live.com/redir?resid=5638EA7EA8BF9B39!3437

You could also go the direction of using a Projection.
I recommend [http://gallery.orchardproject.net/List/Modules/Orchard.Module.Contrib.ProjectionLayouts](Projection Layouts)
Using the shape Layout define a shape for the projection (create a cshtml file with the same name in the theme).

For the template build up the html how you need:
@{
    var buildShapes = Model.BuildShapes;

    IEnumerable<object> items = buildShapes();
    List<object> shapes = items.ToList();
    var itemCount = 0;
}

<div class="projectionItems" data-items-count="@shapes.Count">
@foreach (dynamic shape in shapes)
{      
    <div data-item-number="@(++itemCount)" class="row">  
    @Display(shape)    
    </div>
}
</div>
Add the JavaScript of your favorite slider.

I may create a slider layout at this rate. (I dont have the time right now)