Giter Club home page Giter Club logo

collective.carousel's Introduction

Overview.

collective.carousel is the package that lets you add "carousels" of items in your Plone site. More than one carousels on one page are supported.

collective.carousel is based on Scrollable plugin for JQuery Tools library.

How to get a carousel?

Work of carousel is based on one assumption — you already have a collection that returns results for showing in the carousel.

Carousel can be added in 2 ways:

  • as a viewlet above page's title (content carousel);
  • as a portlet to any portlet manager in your site.

Carousel above page's title (Content carousel).

  • Go to Edit tab on a page where you want to add a carousel;
  • go to Settings;
  • add a collection that will provide content for carousel to Carousel object field;
  • if you want to add more than one carousel, add more collections to the same field;
  • after saving your page, you should see the carousel(s) above your page's title if the collection(s) you chose for the carousel(s) returns any elements.

Carousel in a portlet.

  • On a page where you want to add a carousel click Manage portlets in one of the columns of your site;
  • choose Carousel portlet from Add portlet... menu;
  • collection portlet is a derivative from standard collection portlet in Plone, hence the same fields are available for this type of portlets as well;
  • fill out the fields in the form specifying a collection that will provide content for the carousel portlet.

NOTE content carousels are not inheritable while carousel portlet is inheritable as any other portlet in a Plone site. This means that when you add a content carousel to a folder, the same carousel will not be shown on any object within that folder. At the same time if you add a carousel portlet on a folder, that portlet will be shown for all objects within the folder that don't explicitly block parent portlets.

Tips

What if I want to move carousel to another place?

Content carousel is defined with a regular viewlet. This lets you to move that viewlet to any place in your site the same way you would do with any other viewlet. Read Moving a viewlet from a viewlet manager to another one for more info on how to move viewlets from one viewlet manager to another.

How do I customize carousel's view?

collective.carousel provides a flexible way of customizing the look of items, shown in a carousel based on a content type of the item. collective.carousel comes with 2 bundled views that are available for items, rendered in a carousel:

  • browser/templates/news_item_tile.pt — defines how News Items should be rendered in a carousel;
  • browser/templates/default_tile.pt — how all the rest content types should be rendered in a carousel.

If you need to either override one of the existing views or define a new view for any content type you can do this from your package using ZCML registartion. Please take a look at browser/configure.zcml and testing.zcml for examples of such registrations. Note that there are pages with 2 different names:

  • carousel-view — defines a view for a content type in content carousel;
  • carousel-portlet-view — the view for a content type when shown in a carousel portlet.

So if you need to override/register a view for any specific content type for content carousel, your <browser:page /> has to have carousel-view name. In case you want to override/register a view for carousel portlet, name should be carousel-portlet-view.

I need to do something once the carousel is fully loaded.

The simplest use-case — you have some content carousels placed in a row side by side. Most probably your carousels have different heights and that doesn't look nice when they are placed side by side. So you want to equalize the heights of these carousels with Javascript so that your carousels have the same height. Since collective.carousel already binds load() event to each carousel (resizing the carousel to fit all of it's content) you can not bind one more load() event to a carousel because due to the nature of load() event it might be fired too early when not all content of a carousel is loaded.

For the cases like this collective.carousel provides custom Javascript event resized.carousel that you can attach your special handlers to. Moreover each carousel returns it's height that can be accessed in resized.carousel event.

Here is a simple code snippet of how to adjust the heights of carousels with JQuery:

$("#my-container .carousel").bind('resized.carousel', function(event, newheight) {
    $("#my-container .carousel").each(function() {
        if ($(this).height() < newheight) $(this).height(newheight);
    });
});

Developed by Jarn AShttp://www.jarn.com

Development sponsored by the Bergen Public Libraryhttp://www.nettbiblioteket.no

Dexterity

collective.carouselbehaviour provides Dexterity-based (plone.app.dexterity) content types support.

collective.carousel's People

Contributors

bogdangi avatar cleder avatar mishunov avatar pigeonflight avatar rafa2000 avatar rnixx avatar thet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

collective.carousel's Issues

Effects on Products.PloneSlimbox and collective.prettyphoto

In a Plone 3.3.6 site with collective.carousel (1.4) already installed, I tried installing/using collective.prettyphoto (0.4.3) but this failed to work: in cases where a lightbox was supposed to show up, the browser simply showed the image which would be shown in the lightbox. Removed collective.prettyphoto, installed Products.PloneSlimbox (0.7.1) and got the same problem: no lightbox showing up when it should, only the image which should first go inside it.

After a few tests both in the original site and in another (freshly created) 3.3.6 site, I found out that both collective.prettyphoto and Products.PloneSlimbox work nicely (even if both installed) if they are installed before collective.carousel.

I am not sure if this is the best place to report the above, since I don't know exactly what is causing it. In any case, maybe it occurs via specific script ordering in the portal_javascripts registry? (since this depends on the order in which products are installed; but I haven't tested reordering the scripts 'manually' after installation).

I haven't yet used collective.carousel itself after installing, so for now I can't report any effects on it.

Missed docs directory v1.6.1

Hi,

Could you please upload package to pypi package with docs directory because there is not it.

Getting distribution for 'collective.carousel'.
error: docs/HISTORY.txt: No such file or directory
An error occured when trying to install collective.carousel 1.6.1. Look above this message for any errors that were output by easy_install.
While:
  Installing instance.
  Getting distribution for 'collective.carousel'.
Error: Couldn't install: collective.carousel 1.6.1

Best regards,
Bogdan.

IE9

Hi.
Why doesn't work in IE?
Everything works on firefox.
My carousel portlet is for authenticated users (only within the homepage) and I double checked all the rights on the collection and the images.

L.

Missing <dl> in carousel portlet

The current template for carousel portlet (version 1.5) is not "html valid" because it lacks the tag < dl >. It looks like:
< div class="portletCarouselWrapper" >
< dt class="portletHeader" >< /dt >
< dd class="carousel portletItem" >< /dd >
< /div >

Uncaught TypeError: Cannot call method 'getItems' of undefined carousel.js:21 due to the presence of unrelated .carousel class

The scenario I'm coming upon has to do with the way that carousel.js triggers a new carousel. Basically it looks for the presence of a .carousel class. If that carousel class has nothing to do with the markup associated with collective.carousel then the result is some kind of javascript error.

To see the issue do the following:

  1. install collective.carousel on a brand new plone
  2. Edit any page and add an entry that includes something like
    <p class="carousel">hello</p>
  3. Look at the Console. The result will be the following error showing up in your Console (tested in Chrome)
Uncaught TypeError: Cannot call method 'getItems' of undefined carousel.js:21

A more realistic example is when using the bootstrap carousel in a theme, because it uses the .carousel class but has different markup from collective.carousel.

I think collective.carousel should use a compound selector like .collective.carousel instead of plain .carousel.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.