From 46194503c61c5d9276b692f0be2e85fe4b5e59da Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Thu, 10 Mar 2016 12:23:37 +0100 Subject: [PATCH] Added get-alts --- content/docs/api/db/get-alts/contents.lr | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 content/docs/api/db/get-alts/contents.lr diff --git a/content/docs/api/db/get-alts/contents.lr b/content/docs/api/db/get-alts/contents.lr new file mode 100644 index 00000000..460bf7a5 --- /dev/null +++ b/content/docs/api/db/get-alts/contents.lr @@ -0,0 +1,34 @@ +title: get_alts +--- +module: lektor.db +--- +signature: source=None, fallback=False +--- +summary: Helper function to return the list of alternatives for a source +--- +type: function +--- +version_added: 2.0 +--- +body: + +Given a source this function returns the list of all [Alternatives +:ref](../../../content/alts/) that the source exists as. It does not include +fallbacks unless `fallback=True` is passed. If no source is provided all +configured alts are returned. If alts are not configured at all, the return +value is an empty list. + +This returns only the list of alt short IDs. Access to the configured name +of the alt within the project config is not available. Databags should be +used to provide alts with a humand readable title. + +## Example + +```html+jinja +

Other languages: +

+```