Skip to the content
Documentation

ezpreference

No ratings yet

Summary

Provides access to a user's preference values.

Usage

ezpreference( preference )

Parameters

Name Type Description Required
preference string The name of the preference that should be extracted. Yes.

Returns

A string containing the contents/value of the specified preference.

Description

This operator makes it possible to extract the preference values of the current user. The name of the desired preference must be provided as a parameter. The function returns the value/contents of the specified preference. The current user can set a preference by requesting a URL of the following type:

/user/preferences/set/[name_of_preference]/[value]

Examples

Example 1
{ezpreference( 'bookmark_menu' )}

Returns the value/contents of the "bookmark_menu" preference for the current user.

Contributors

Comments (1 historical)

Written by readers of the earlier documentation sites, kept as they were.

  1. Default value?

    Gabriel Ambuehl ·

    Is there any way to set a default value in case the user never triggers a preference?

Comments

Add a comment

Comments are read by a moderator before they appear.