Working on a new featured content slider module

Topics: Announcements
Feb 3, 2012 at 6:12 PM

It's not published to the gallery yet, but I have a project set up on codeplex:

The difference between this and the other "featured item slider" modules already in the gallery is this one will let you use arbitrary html elements as the slide contents. I checked out FeaturedItemsSlider module and it was pretty good but too rigid in that it only uses images and a headline and sub-headline. If editors want to use multiple layouts, or change layouts in the future it would mean editing the content parts and doing data migrations to support the new fields/layouts. 

With this module you will be able to edit each slide with a WYSIWYG editor, allowing you to put text, images, videos, or any other html markup you want in the show. To provide some structure for non-coder content editors who will be using this, you can set up TinyMce content templates. I need this functionality for my current project -- about 80% done. Once it's more polished I'll publish it to the gallery but a usable version should be available on codeplex within the next couple of days. 

I am using Awkward Showcase as the basis for the slider control. 

Awkward Showcase site:


Feb 4, 2012 at 9:59 AM

The most ideal way would be allowing individual content items for each slide with a custom display type, that way you can build slides from any Parts you like; just a HTML body if you liked, or you can have an Image Field and Title, or anything else you wanted. Actually it's possible to do this with Mechanics; you can just give your widget a relationship to other content, then set a display type and add some Javascript to wrap the slider around the generated list.

Feb 4, 2012 at 5:46 PM
Edited Feb 4, 2012 at 5:47 PM

I agree that being able to use content items for slides is a good idea. I'm not sure how to do it though. If someone points me in the right direction I will give it a shot. 

I'll still want to allow wysiwyg/html editing to allow the user to define the slide with custom HTML. At my company we often get ad hoc requests for content to be entered that will never be used again, and being able to enter HTML for a promo that's live for a week or two is the easiest way to handle; and the editors can mostly do those without knowing a ton about how Orchard works, how to define parts or customize displays, etc.

The content part functionality will be useful for cases when we want to link to a page/part that has some social media part attached; we can automatically display the # of likes/comments/+1's as part of the slide. I know that business people will inevitably ask for something else that doesn't make sense -- "Can you make a slide that links to X part, but shows the # of comments for Y widget? I don't care if it's weird, we already sold it."

Feb 4, 2012 at 5:51 PM

The ContentSlider on codeplex right now works enough to be used in my current project if anyone wants to check it out.

Feb 4, 2012 at 6:00 PM

If you allow arbitrary content types then you can just add BodyPart and get HTML/WYSIWYG editing for free, using whatever editor is installed for the flavour you choose. So it gives you complete flexibility.

When I get a chance and have fixed some more issues with Mechanics I'll have a go at configuring a slider like this, shouldn't be too hard to do.

Feb 4, 2012 at 7:35 PM

How do I attach arbitrary content items to my slide part? What code or module can I look at as an example of this? 

Feb 4, 2012 at 9:50 PM

It's the other way around: you attach your part to content items or content types. Examples: pretty much any content part in existence.

Feb 4, 2012 at 10:27 PM

@bertrand I was suggesting linking content items together e.g. just using Container/Containable. TheMonarch, look in the Core/Containers module for examples of a simple list structure. I'm working on a module called Mechanics that does relationships in a more flexible way but it's a bit tricky to use, perfecting some things at the moment :)

Feb 4, 2012 at 10:55 PM

Thanks, randompete. I'll take a look there. I skipped over the lists part of the documentation when I first read it so I never learned about Container/Containable and forgot those existed. 

Feb 4, 2012 at 10:56 PM

Ah, OK, sorry for the misunderstanding.