Announcement

Collapse
No announcement yet.

How to translate custom widget title

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tibald
    replied
    It work. Ty.

    Leave a comment:


  • Glenn Vergara
    replied
    See changes in red.

    Code:
    <vb:if condition="!empty($page['searchTitle'])">
        {vb:set searchTitle, {vb:raw page.searchTitle}}
    <vb:elseif condition="!empty($widgetConfig['searchTitle'])" />
        {vb:set searchTitle, {vb:raw widgetConfig.searchTitle}}
        {vb:set searchTitle, {vb:phrase {vb:raw searchTitle}}}
    <vb:elseif condition="!empty($widgetConfig['title'])" />
        {vb:set searchTitle, {vb:raw widgetConfig.title}}
        {vb:set searchTitle, {vb:phrase {vb:raw searchTitle}}}
    <vb:else />
        {vb:set searchTitle, {vb:phrase search}}
    </vb:if>

    Leave a comment:


  • Tibald
    replied
    Hum, now need same for Search widget...

    Code:
    <vb:if condition="!empty($page['searchTitle'])">
        {vb:set searchTitle, {vb:raw page.searchTitle}}
    <vb:elseif condition="!empty($widgetConfig['searchTitle'])" />
        {vb:set searchTitle, {vb:raw widgetConfig.searchTitle}}
    <vb:elseif condition="!empty($widgetConfig['title'])" />
        {vb:set searchTitle, {vb:raw widgetConfig.title}}
    <vb:else />
        {vb:set searchTitle, {vb:phrase search}}
    </vb:if>
    
    <div class="canvas-widget search-widget" data-widget-id="{vb:raw widgetid}" data-widget-instance-id="{vb:raw widgetinstanceid}">
        {vb:template module_title, widgetConfig={vb:raw widgetConfig}, title={vb:raw searchTitle}, can_use_sitebuilder={vb:raw user.can_use_sitebuilder}}
    How to modify that to get same effect ?)

    Leave a comment:


  • Tibald
    replied
    This work perfect!! Ty u vm!!

    Leave a comment:


  • Glenn Vergara
    replied
    Try this:

    Code:
    {vb:set widgetConfig['title'], {vb:phrase {vb:raw widgetConfig['title']}}}
    instead of:

    Code:
    {vb:set widgetConfig.title, {vb:phrase {vb:raw widgetConfig.title}}}

    Leave a comment:


  • Tibald
    replied
    I done with it, but not help (
    In sitebuilder for title i typed phrase id number
    I tryed type skype_chat (phrase varname) and id , both not work.
    In template i added red code before blue, title changed to text Array.title

    Mb u forgot add some another modification which is required ?)

    Leave a comment:


  • Glenn Vergara
    replied
    That would require modification of widget_statichtml template.

    Code:
    {vb:set widgetConfig.title, {vb:phrase {vb:raw widgetConfig.title}}}
    {vb:template module_title, widgetConfig={vb:raw widgetConfig}, can_use_sitebuilder={vb:raw user.can_use_sitebuilder}}
    Find the code in blue and put the code in red before it.

    This is not tested but the idea is you overwrite the widget title (which is the phrase id you set in the HTML module title and has translation in the Phrase Manager) with the translated title.

    This would affect all HTML modules across the site. You have to always set the HTML module title as phrase id.

    Leave a comment:


  • Tibald
    replied
    Yes but if i change language it still not changed.. i want ask how to set it not static but translated if set another language)

    Leave a comment:


  • Glenn Vergara
    replied
    When you edit the Static HTML Module in Sitebuilder, you can specify the title in the Module Configuration dialog.

    Leave a comment:


  • Tibald
    started a topic How to translate custom widget title

    How to translate custom widget title

    I add own html widget and want to use multilingual title in it.
    Somebody known ho w to do that ?
    I try to add phrase and use it in title but it not work for me.
    So possible somebody can write little step-by-step tip how to do it?
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X