Skip to content

Commit

Permalink
minor fixes in slider
Browse files Browse the repository at this point in the history
  • Loading branch information
moldcraft committed Apr 26, 2016
1 parent 141f413 commit 169bab5
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions extension/slider/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,37 +191,29 @@ The ``$data`` variable that is available in view, has the following structure:
)
);
Create advanced slider type
---------------------------

If you want to create an advanced slider with your own extra logic,
you must create a class file named ``class-fw-extension-{slider-type}.php``
within the slider type directory.

In our case the slider type is ``bx-slider``, so the class file will be located in
``framework-customizations/extensions/media/extensions/slider/extensions/bx-slider/class-fw-extension-bx-slider.php``
In this case the slider type is ``demo-slider``, so the class file will be located in
``framework-customizations/extensions/media/extensions/slider/extensions/bx-slider/class-fw-extension-demo-slider.php``
and will contain:

.. code-block:: php
<?php if (!defined('FW')) die('Forbidden');
class FW_Extension_Bx_Slider extends FW_Slider
{
/**
* @internal
*/
public function _init()
{
}
class FW_Extension_Demo_Slider extends FW_Slider {
/** @internal */
public function _init() {}
}
Then you can take a look at the ``FW_Slider`` methods to learn what are they doing and decide
which one you will overwrite.



Frontend render
---------------

Expand All @@ -233,7 +225,7 @@ There are two ways you can display a slider in frontend:

.. code-block:: php
fw()->extensions->get('slider')->render_slider(10, array(
fw()->extensions->get('slider')->render_slider($slider_post_id, array(
'width' => 300,
'height' => 200
));
Expand Down

0 comments on commit 169bab5

Please sign in to comment.