<commit_before>#################
Plugins reference
#################

.. :module:: cms.plugins.file

.. :class:: cms.plugins.file.models.FilePlugin

****
File
****

Allows you to upload a file. A filetype icon will be assigned based on the file
extension.

For installation be sure you have the following in the :setting:`django:INSTALLED_APPS`
setting in your project's ``settings.py`` file::

    INSTALLED_APPS = (
        # ...
        'cms.plugins.file',
        # ...
    )

You should take care that the directory defined by the configuration setting
:setting:`CMS_PAGE_MEDIA_PATH` (by default ``cms_page_media/`` relative to
:setting:`django:MEDIA_ROOT`) is writable by the user under which django will be
running.

You might consider using `django-filer`_ with `django CMS plugin`_ and its
``cmsplugin_filer_file`` component instead.

.. warning::

    The builtin file plugin does only work with local storages. If you need
    more advanced solutions, please look at alternative file plugins for the
    django CMS, such as `django-filer`_.

.. _django-filer: https://github.com/stefanfoulis/django-filer
.. _django CMS plugin: https://github.com/stefanfoulis/cmsplugin-filer

.. :module:: cms.plugins.flash

.. :class:: cms.plugins.flash.cms_plugins.FlashPlugin

*****
Flash
*****

Allows you to upload and display a Flash SWF file on your page.

For installation be sure you have the following in the
:setting:`django:INSTALLED_APPS` setting in your project's ``settings.py`` file::

    INSTALLED_APPS = (
        # ...
        'cms.plugins.flash',
        # ...
    )

.. :module:: cms.plugins.googlemap

.. :class:: cms.plugins.googlemap.cms_plugins.GoogleMapPlugin

*********
GoogleMap
*********

Displays a map of an address on your page.

For installation be sure you have the following in the :setting:`django:INSTALLED_APPS`
setting in your project's ``settings.py`` file::

    INSTALLED_APPS = (
        # ...
        'cms.plugins.googlemap',
        # ...
    )

.. :module:: cms.plugins.link

.. :class:: cms.plugins.link.cms_plugins.LinkPlugin

****
Link
****

Displays a link to an arbitrary URL or to a page. If a page is moved the URL
will still be correct.

For installation be sure to have the following in the :setting:`django:INSTALLED_APPS`
setting in your project's ``settings.py`` file::

    INSTALLED_APPS = (
        # ...
        'cms.plugins.link',
        # ...
    )

.. note:: As of version 2.2, the link plugin no longer verifies the existance of
          link targets.


.. :module:: cms.plugins.picture

.. :class:: cms.plugins.picture.cms_plugins.PicturePlugin


*******
Picture
*******

Displays a picture in a page.

For installation be sure you have the following in the :setting:`django:INSTALLED_APPS`
setting in your project's ``settings.py`` file::

    INSTALLED_APPS = (
        # ...
        'cms.plugins.picture',
        # ...
    )

If you want to resize the picture you can get a thumbnail library. We
recommend `sorl.thumbnail <http://thumbnail.sorl.net/>`_.

In your project template directory create a folder called ``cms/plugins`` and
create a file called ``picture.html`` in there. Here is an example
``picture.html`` template:

.. code-block:: html+django

    {% load i18n thumbnail %}
    {% spaceless %}

    {% if picture.url %}<a href="{{ picture.url }}">{% endif %}
    {% ifequal placeholder "content" %}
        <img src="{% thumbnail picture.image.name 484x1500 upscale %}" {% if picture.alt %}alt="{{ picture.alt }}" {% endif %}/>
    {% endifequal %}
    {% ifequal placeholder "teaser" %}
        <img src="{% thumbnail picture.image.name 484x1500 upscale %}" {% if picture.alt %}alt="{{ picture.alt }}" {% endif %}/>
    {% endifequal %}
    {% if picture.url %}</a>{% endif %}

    {% endspaceless %}

In this template the picture is scaled differently based on which placeholder
it was placed in.

You should take care that the directory defined by the configuration setting
:setting:`CMS_PAGE_MEDIA_PATH` (by default ``cms_page_media/`` relative to
:setting:`django:MEDIA_ROOT`) is writable by the user under which django will be
running.<commit_msg>updated sorl.thumbnail template tags to use new format (thumbnail source dims opts as var), rendered the url of that var and closed the template tag<commit_after>#################
Plugins reference
#################

.. :module:: cms.plugins.file

.. :class:: cms.plugins.file.models.FilePlugin

****
File
****

Allows you to upload a file. A filetype icon will be assigned based on the file
extension.

For installation be sure you have the following in the :setting:`django:INSTALLED_APPS`
setting in your project's ``settings.py`` file::

    INSTALLED_APPS = (
        # ...
        'cms.plugins.file',
        # ...
    )

You should take care that the directory defined by the configuration setting
:setting:`CMS_PAGE_MEDIA_PATH` (by default ``cms_page_media/`` relative to
:setting:`django:MEDIA_ROOT`) is writable by the user under which django will be
running.

You might consider using `django-filer`_ with `django CMS plugin`_ and its
``cmsplugin_filer_file`` component instead.

.. warning::

    The builtin file plugin does only work with local storages. If you need
    more advanced solutions, please look at alternative file plugins for the
    django CMS, such as `django-filer`_.

.. _django-filer: https://github.com/stefanfoulis/django-filer
.. _django CMS plugin: https://github.com/stefanfoulis/cmsplugin-filer

.. :module:: cms.plugins.flash

.. :class:: cms.plugins.flash.cms_plugins.FlashPlugin

*****
Flash
*****

Allows you to upload and display a Flash SWF file on your page.

For installation be sure you have the following in the
:setting:`django:INSTALLED_APPS` setting in your project's ``settings.py`` file::

    INSTALLED_APPS = (
        # ...
        'cms.plugins.flash',
        # ...
    )

.. :module:: cms.plugins.googlemap

.. :class:: cms.plugins.googlemap.cms_plugins.GoogleMapPlugin

*********
GoogleMap
*********

Displays a map of an address on your page.

For installation be sure you have the following in the :setting:`django:INSTALLED_APPS`
setting in your project's ``settings.py`` file::

    INSTALLED_APPS = (
        # ...
        'cms.plugins.googlemap',
        # ...
    )

.. :module:: cms.plugins.link

.. :class:: cms.plugins.link.cms_plugins.LinkPlugin

****
Link
****

Displays a link to an arbitrary URL or to a page. If a page is moved the URL
will still be correct.

For installation be sure to have the following in the :setting:`django:INSTALLED_APPS`
setting in your project's ``settings.py`` file::

    INSTALLED_APPS = (
        # ...
        'cms.plugins.link',
        # ...
    )

.. note:: As of version 2.2, the link plugin no longer verifies the existance of
          link targets.


.. :module:: cms.plugins.picture

.. :class:: cms.plugins.picture.cms_plugins.PicturePlugin


*******
Picture
*******

Displays a picture in a page.

For installation be sure you have the following in the :setting:`django:INSTALLED_APPS`
setting in your project's ``settings.py`` file::

    INSTALLED_APPS = (
        # ...
        'cms.plugins.picture',
        # ...
    )

If you want to resize the picture you can get a thumbnail library. We
recommend `sorl.thumbnail <http://thumbnail.sorl.net/>`_.

In your project template directory create a folder called ``cms/plugins`` and
create a file called ``picture.html`` in there. Here is an example
``picture.html`` template:

.. code-block:: html+django

    {% load i18n thumbnail %}
    {% spaceless %}

    {% if picture.url %}<a href="{{ picture.url }}">{% endif %}
    {% ifequal placeholder "content" %}
        <img src="{% thumbnail picture.image.name "484x1500" upscale as im %}{{ im.url }}{% endthumbnail %}" {% if picture.alt %}alt="{{ picture.alt }}" {% endif %}/>
    {% endifequal %}
    {% ifequal placeholder "teaser" %}
        <img src="{% thumbnail picture.image.name "484x1500" upscale as im %}{{ im.url }}{% endthumbnail %}" {% if picture.alt %}alt="{{ picture.alt }}" {% endif %}/>
    {% endifequal %}
    {% if picture.url %}</a>{% endif %}

    {% endspaceless %}

In this template the picture is scaled differently based on which placeholder
it was placed in.

You should take care that the directory defined by the configuration setting
:setting:`CMS_PAGE_MEDIA_PATH` (by default ``cms_page_media/`` relative to
:setting:`django:MEDIA_ROOT`) is writable by the user under which django will be
running.
{'fraction_non_alphanumeric': 0.13701214479424595, 'fraction_numerical': 0.004244782454899187, 'mean_word_length': 3.358684480986639, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3300585', 'n_tokens_mistral': 2668, 'n_tokens_neox': 2479, 'n_words': 871}