Projet

Général

Profil

Paste
Télécharger (5,5 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / flexslider / README.md @ 651307cd

1 85ad3d82 Assos Assos
About
2
=====
3
Integrates the FlexSlider library into Drupal.
4
5
Known Issues
6
------------
7
8
- IE10 requires an updated version of jQuery to work properly with FlexSlider. Please see http://drupal.org/project/jquery_update
9
10
Current Options
11
---------------
12
Allows you to use FlexSlider in a few different ways
13
14
- As a library to be used with any other theme or module by calling flexslider_add() (N.B. You may also use libraries_load('flexslider') or drupal_add_library('flexslider', 'flexslider'), but only if you want to control everything manually).
15
- Integrates with Fields (flexslider_fields)
16
- Adds a Views display mode (flexslider_views)
17
18
About FlexSlider
19
----------------
20
21
Library available at https://github.com/woothemes/FlexSlider
22
23
- Simple, semantic markup
24
- Supported in all major browsers
25
- Horizontal/vertical slide and fade animations
26
- Multiple slider support, Callback API, and more
27
- Hardware accelerated touch swipe support
28
- Custom navigation options
29
- Use any html elements in the slides
30
- Built for beginners and pros, alike
31
- Free to use under the MIT license
32
33
Installation
34
============
35
36
Dependencies
37
------------
38
39
- [Libraries API 2.x](http://drupal.org/project/libraries)
40
- [FlexSlider Library](https://github.com/woothemes/FlexSlider)
41
42
Tasks
43
-----
44
45 a60304ed Assos Assos
1. Download the FlexSlider library from https://github.com/woothemes/FlexSlider
46
    - Only the 2.x branch is supported
47 85ad3d82 Assos Assos
2. Unzip the file and rename the folder to "flexslider" (pay attention to the case of the letters)
48
3. Put the folder in a libraries directory
49
    - Ex: sites/all/libraries
50
4. The following files are required (last file is required for javascript debugging)
51
    - jquery.flexslider-min.js
52
    - flexslider.css
53
    - jquery.flexslider.js
54
5. Ensure you have a valid path similar to this one for all files
55
    - Ex: sites/all/libraries/flexslider/jquery.flexslider-min.js
56
57
That's it!
58
59
Drush Make
60
----------
61
62
You can also use Drush Make to download the library automatically. Simply copy/paste the 'flexslider.make.example' to 'flexslider.make' or copy the contents of the make file into your own make file.
63
64
Usage
65
======
66
67
Option Sets
68
-----------
69
70
No matter how you want to use FlexSlider (with fields or views) you need to define "option sets" to tell FlexSlider how you want it to display. An option set defines all the settings for displaying the slider. Things like slide direction, speed, starting slide, etc... You can define as many option sets as you like and on top of that they're all exportable! Which means you can carry configuration of your Flex Slider instances from one site to the next or create features.
71
72
Go to admin/config/media/flexslider
73
74
From there you can edit the default option set and define new ones. These will be listed as options in the various forms where you setup FlexSlider to display.  NOTE: under advanced options, you can set a namespace prefix for the optionset.  This will allow you to build custom CSS for each optionset.  Start by copying the flexslider_img.css from the assets subfolder to your theme.  Build new custom CSS for each prefix in your optionsets.
75
76
Carousels
77
---------
78
79
Carousels can be created with Flexslider2 by setting an Item Width for images and a Margin Width in the optionset.  Use the flexslider_thumbnail image style and set your item width to fit the desired number of images into the div space available.  NOTE: the margin width setting should correspond IN PIXELS to the margin widths set by your img CSS in your theme.  This will allow Flexslider to properly calculate the "total width" of the image+margins so that horizontal scrolling behaves properly.
80
81
Flexslider Views
82
----------------
83
84
Flex Slider Views allows you to build views which display their results in Flex Slider. Similarly to how you can output fields as an "HTML List" or "Table", you can now select "Flex Slider" as an option.
85
86
Create or edit a view and ensure it can load a content type which contain image fields. Set your display fields to include an image field. In the field settings, DO NOT SET THE FORMATTER TO FLEXSLIDER. This will attempt to put Flex Sliders inside other Flex Sliders and will just get messy. Ensure you don't include any wrapper markup, labels or container markup for the field value itself. Save your field.
87
88
Next, go to "Format" in the main Views windows. Click and select "Flex Slider", then select your option set. Save your view and you should see your results displayed in Flex Slider.
89
90
Debugging
91
---------
92
93
You can toggle the development version of the library in the administrative settings page. This will load the unminified version of the library.  Uncheck this when moving to a production site to load the smaller minified version.
94
95
### Image Width/Height Attributes
96
97 a60304ed Assos Assos
If your images aren't resizing, ensure the width and height attributes are removed. The module will attempt to remove them automatically on any image matching the pattern
98 85ad3d82 Assos Assos
99
    ul.slides > li > img
100 a60304ed Assos Assos
101 85ad3d82 Assos Assos
102
103
Export API
104
==========
105
106
You can export your FlexSlider option presets using CTools exportables. So either using the Bulk Export module or Features.
107
108
External Links
109
==============
110
111 a60304ed Assos Assos
- [Wiki Documentation for FlexSlider 2](https://github.com/woothemes/FlexSlider/wiki/FlexSlider-Properties)
112
113
General Notes
114
=============
115
116
Using FlexSlider with Advagg and Domain Access
117
----------------------------------------------
118
119
If you use multiple domains or subdomains together with advagg module you have to set the following option at the advagg config page admin/config/development/performance/advagg ”Include the base_url variable in the hooks hash array.” This will generate separate aggregates for each domain.