## auto_discovery_link_tag

## Description

Return a link tag that browsers and news readers can use to auto-detect an RSS or ATOM feed.

## Syntax



## Example



## Options

NameTypeDescription
titleStringBy default, its value is 'RSS'
relStringBy default, its value is 'alternate'
typeStringBy default, its value is 'application/rss+xml'

## concat

## Description

Append strings passed in args to the input.

## Syntax



## Example



## dasherize

## Description

Replace underscores and spaces with dashes in the string.

## Syntax



## Example



## default

## Description

Return the value parameter if the input is either null or empty.

## Syntax



## Example

(if the value of params.author is null)



## default_pagination

## Description

Render the navigation for a paginated collection. Input is the variable returned by the paginate tag

## Syntax



## Example



## Options

NameTypeDescription
previousStringLabel of the previous link. By default, the value of I18n.t('pagination.previous') is used.
nextStringLabel of the next link. By default, the value of I18n.t('pagination.previous') is used.

## distance_of_time_in_words

## Description

The distance_of_time_in_words filter uses Rails' built-in distance_of_time_in_words helper to measure the difference between two dates and return a representation of that difference in words.

## Syntax



The filter takes a date as input and another date as the first argument. The order of the dates doesn't matter; the earlier date can be either the input or the argument.

## Examples



## Localization

The filter's output is automatically localized to the current locale. These localizations can be customized in the Rails locale files for your Locomotive Engine. Please use the below sample as a guide.



Locomotive comes with default translations for this filter for some languages. However, if you receive a "translation missing" error, you will need to add translations to the locale file of your locomotive engine.



## encode

## Description

Escape an URI. Useful when using Liquid to generate a JSON response.

## Syntax



## Example



## first

## Description

Return the first occurrence of the input object. If the object is a String, it returns the first letter. If it is an Array, the first entry is returned. If the input is a collection, the first method is called on that collection.

## Syntax



## Examples



## flash_tag

## Description

Embed a flash movie into a page.

## Syntax



## Example



## Options

NameTypeDescription
widthStringpixel or %
heightStringpixel or %

## format_date

## Description

alias for localized_date.

## Syntax



## image_tag

## Description

Build the HTML img tag.

## Syntax



## Example



## Options

NameTypeDescription
altString
titleString

## javascript_tag

## Description

Build the link tag of a theme stylesheet.

## Syntax



## Example



## javascript_url

## Description

Return the url of a theme asset javascript.

## Syntax



## Example



## last

## Description

Return the last occurrence of the input object. If the object is a String, it returns the last letter. If it is an Array, the last entry is returned. If the input is a collection, the last method is called on that collection.

## Syntax



## Examples



## localized_date

## Description

Pretty print a date.

## Syntax



## Examples



## Options

NameTypeDescription
formatStringIt depends on the current locale. For the 'en' locale, it is "%m/%d/%Y". Read the [syntax reference](🔗).
localeStringOptional. By default, it is the current locale.

## markdown

## Description

The markdown filter converts text formatted with Markdown to HTML using the ruby gem Redcarpet. For a complete explanation of markdown syntax, please visit the Markdown Syntax.

## Syntax



## Example



## money

## Description

Formats a number into a currency string (e.g., $13.65). You can customize the format in the options hash.

## Examples



## multi_line

## Description

Insert a <br /> tag in front of every \n linebreak character.

## Syntax



## Example

outputs



## parse_date

## Description

Parse the given representation of date, and create a date object.

## Syntax



## Options

NameTypeDescription
formatStringBy default, it uses a localized format. For instance, in English, that will be: **"%m/%d/%Y"**. You're free to use any format you want.

## parse_date_time

## Description

Parse the given representation of date time, and create a date time object.

## Syntax



## Options

Column Title
Column Title
Column Title
formatStringBy default, it uses a localized format. For instance, in English, that will be: **"%m/%d/%Y %H:%M"**. You're free to use any format you want.

## random

## Description

Get a randomly number greater than or equal to 0 and strictly less than the max number passed in parameter.

## Syntax



## Example



(or any numbers between 0 and 9.)

## resize

## Description

Resize any image on the fly by calling behind the scene the DragonFly gem. The url to the dynamically resized image is returned. The processing relies on ImageMagick. Additional options like JPEG compression rate are supported.

## Syntax



## Examples



By default, the Rack::Cache middleware is called for the caching. If you host your LocomotiveCMS on Heroku please visit [this page](🔗) for setup instructions.

## Options

NameTypeDescription
resize_stringStringThe ImageMagick geometry string. See the following [link](🔗) for examples.
qualityIntegerCompress image, look [here](🔗) for meaning of the number.
auto_orientBooleanFix EXIF orientation issues, look [here](🔗) for details.
stripBooleanRemove extra possibly unnecessary metadata, look [here](🔗) for details.
progressiveBooleanMake JPEG progressive, calling ImageMagick with [-interlace Plane](🔗) option.
optimizeIntegerShortcut to quality: and also applies strip and progressive.
filtersStringAccess to any ImageMagick arguments.

## shuffle

## Description

Randomly sort an array. It also works with content entries if you've got a couple of them.

## Examples



## str_modulo

## Description

Print the input string every modulo occurences.

## Syntax



## Example



## Options

NameTypeDescription
indexIntegerThe counter. Usually, the index variable within a for loop
moduloIntegerBy default, it is the current locale

## stylesheet_tag

## Description

Return the link tag of a theme stylesheet.

## Syntax



## Example



## Options

NameTypeDescription
mediaStringBy default, its value is 'screen'

## stylesheet_url

## Description

Return the url of a theme asset stylesheet.

## Syntax



## Example



## textile

## Description

The textile filter converts text formatted with Textile to HTML using the popular ruby gem RedCloth. For a complete explanation of textile syntax, please visit the Textile Reference Manual for RedCloth.

## Syntax



## Example



## theme_image_tag

## Description

Return the image tag of a theme image.

## Syntax



## Example



## Options

NameTypeDescription
altString
titleString

## theme_image_url

## Description

Return the url of a theme image.

## Syntax



## Example



## translate

## Description

When your site is localized, hard-coded static strings are not permitted. That's why you need to use translations (see the [localization guide)](🔗)).

## Syntax



## Options

NameTypeColumn Title
localeString

## Examples



Assuming that in the **config/translations.yml**, the following entry exists




## underscore

## Description

Make an underscored, lowercase form from the expression in the string.

## Syntax



## Example