Transcribe Documentation

Tag Reference

Transcribe Entries Tag:
{exp:transcribe:entries}
    Your template code
{/exp:transcribe:entries}

Tag Parameters
  • All the same parameters as the exp:channel:entries tag.
  • transcribe_add_lang = pipe separated list of additional languages to include (ex: "abbreviation_1|abbreviation_2")

Variables:

The following tags are also available in the exp:transcribe:entries loop

{transcribe_entry_lang_abbr}
{transcribe_entry_lang_name}
{transcribe_entry_lang_id}

Legacy Parsing Fallback

If you upgraded your site to Transcribe 3 and cannot change your exp:channel:entries tags to the new exp:transcribe:entries tags, you can use the following override in your configuration file to enable the legacy parsing mode.

$config['transcribe_legacy_parser'] = 'yes';

NOTE: This is a temporary override and will be removed in Transcribe 4

Translate Tag:
{exp:transcribe:translate}
    Content to replace
{/exp:transcribe:translate}

Tag Parameters
  • id = the variable id to use
  • name = the variable name to use
  • site = "msm site short name" allows you to pull a variable from a specified MSM site
  • lang = "lang abbreviation" sets the language for a given variable

This tag pair replaces the content between the tags with the translated content variable of the current language with the id or name specified. If a variable isn't found in the selected language, Transcribe will fallback to the content between the tag pair.

Replace Tag:
{exp:transcribe:replace}

Tag Parameters
  • id = the variable id to use
  • name = the variable name to use
  • site = "msm site short name" allows you to pull a variable from a specified MSM site
  • lang = "lang abbreviation" sets the language for a given variable

Outputs the translated content variable of the current language with the id or name specified.

Language Tag:
{exp:transcribe:language}

Tag Parameters
  • id = the language id to use
  • name = the language name to use

Sets the language to be used from the template. This can be used to override the default behavior of Transcribe which is to figure out what language to load automatically.

Language Abbreviation Tag:
{exp:transcribe:language_abbreviation}
{transcribe:language_abbreviation}

Returns the abbreviation of the current language. Useful for front-end (HTML/CSS) development.

Alternatively {transcribe:language_abbreviation} can be used as an early parse order variable to return the current language abbreviation

URI Tag:
{exp:transcribe:uri}

Tag Parameters
  • path = the path to output
  • site_url = "no" default is yes. This removes the site_url from the returned url
  • entry_id = entriy id
  • lang = language_abbreviation
  • trim_slashes = "yes" default is no. This removes slashes from the returned url

Outputs the path specified in it's translated state for the current language. Used as a replacement to {path=""}.


Structure Integration

If you're using Structure with Transcribe and need your transcribed URIs to show in your Structure Nav, you may need to use an "embed" like so:

{embed="_embeds/your-embed" your_path_var="{exp:transcribe:uri path='/your-page' site_url='no'}"}

Inside your embed, you'd put the Structure nav tag you need to use:

<ul>
{exp:structure:nav_basic show_depth="4" start_from="{embed:your_path_var}"}
    <li><a href="{root:page_url}">{root:title}</a></li>
{/exp:structure:nav_basic}
</ul>
Language_Links Tag:
{exp:transcribe:language_links}

Variables:
  • id = id of the language
  • name = name of the language
  • abbreviation = abbreviation of the language
  • link = link to the action url to switch to the language
  • current = true if this language is the currently selected language; false otherwise.

Logic Check

Use the tag {no_[Language Abbreviation]} for logic inside the {exp:transcribe:language_links} tag pair.

Example:

{if no_en} Do something {/if}

{rel:entry_id} = entry_id for the related language specific entry


Tag Pair

Use the tag {[Language Abbreviation]_data} to display content specific to that language.

Example:

{en_data} Your English content here {/en_data}

This tag pair can only be used in conjunction with the has_entry and entry_id params.

It also has the following variables:

  • {abbreviation}
  • {id}
  • {name}
  • {force_prefix}
  • {enabled}

Tag Parameters

entry_id = current entry id being used

  • has_entry = "yes"
  • show_all = "yes" This will show all language links. Even for languages disabled in the CP.

    Retrieve an array of available languages for the current site. Can be used in the template to create a language switcher.

    Using the entry_id parameter in conjunction with the has_entry parameter will only output links for languages that have entries related to the entry_id passed in

  • Entry ID's tag:
    {exp:transcribe:entry_ids}

    Tag Parameters

    channel = Channel name

    Outputs the entry ids in the channel specified for the current language.

    No Match tag:
    {exp:transcribe:no_match}

    Tag Parameters
    • url = The url you don't want Transcribe to use when switching languages
    • segment = When this segment is found in the URL the language switcher won't try to switch languages to this URL

    This tag allows you to specify URLs that you don't want the language switcher to place the user on when changing languages. When used with the segment parameter, if the segment specified is found anywhere in the URL the user won't be placed on the translated version of that page.

    When this tag is used, Transcribe will look further back in the ExpressionEngine browsing history to determine the page that the user should be placed on.


    How To Use

    Place this tag in a global template like your header or footer like so:

    {exp:transcribe:no_match url="/css/style.css"}
    Breadcrumb Tag:
    {exp:transcribe:breadcrumb}

    Tag Parameters
    • leading_slash = yes or no adds a leading slash to the url. Defaults to no
    • trailing_slash = yes or no adds a trailing slash to the url. Defaults to no
    Variables:
    • site_url = Website URL with language abbreviation if injected
    • crumb_uri = uri for a given crumb
    • first = Boolean TRUE for first crumb
    • last = Boolean TRUE for last crumb
    • breadcrumb:title = entry title
    • entry_id = entry_id for this crumb item

    This tag allows you to setup a breadcrumb trail on Structure pages that reflects the language specific trail

    Variables:
    {exp:transcribe:language_abbreviation}
    {transcribe:language_abbreviation}

    Returns the abbreviation of the current language. Useful for front-end (HTML/CSS) development.


    {transcribe:segment_x}

    Returns the segment as it appears in the browser (except for the language abbreviation). This is an early parse order variable.

    Example:
    http://domain.com/foo/bar/test
    http://domain.com/fr/foo/bar/test

    Both of the above URLs return these values (as the language abbreviation is ignored):

    {transcribe:segment_1} = foo
    {transcribe:segment_2} = bar
    {transcribe:segment_3} = test

    {transcribe:last_segment}

    Returns the last segment as it appears in the browser. This is an early parse order variable.

    Support

    Having problems setting up and/or using Transcribe? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.