Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alastair Gordon 7 posts 107 karma points
    Mar 27, 2019 @ 15:38
    Alastair Gordon
    0

    Umbraco 8 - Custom Dashboard - Language Settings

    Hi,

    This I suspect is going to be a total Newbie question, which is fair because although I have been developing FOR a couple of Umbraco 7 sites, this is the first time I have deployed/developed a brand new Umbraco site.

    One of the tools I need for Admins of this site will be to set percentage surcharge figures onto prices being returned from an external webservice. As a result, I wanted to add a new top Section called 'Surcharges' (e.g 'Content Media Settings ... Surcharges).

    When I add this to the package.manifest for the Surcharges folder in App_Plugins, nothing appears:

    "sections": [ { "alias": "surchargeSection", "name": "Surcharges"}],
    

    I can however get a link to appear within the Content section using the following:

    "dashboards": [{
      "alias": "Surcharges",
      "view": "/App_Plugins/Surcharges/surcharges.html",
      "sections": [ "content" ],
      "weight": 100
    } ]
    

    However, this renders out the word 'Surcharges' with additional [] brackets:

    Content links

    Anyone got a clue how to get a new Section or at the very least how to get rid of the square brackets?!!

    Thanks in advance!

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Mar 27, 2019 @ 20:59
    Marc Goodson
    0

    Hi Alastair

    There is some documentation here: https://our.umbraco.com/Documentation/Extending/Language-Files/Language-Files-For-Packages/

    about adding 'language files' for packages,

    With a custom section etc in the backoffice, the name is used as a 'key' to look up the relevant translation of a name to display in the appropriate language for the current user.

    So if you create a folder called 'Lang' in your /app_plugins/mycustomsection folder

    and in there add a file called en-us.xml

    (the name of the file matches the language code of the user, en-us is usually the default)

    and in this file and the following xml:

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <language alias="en" intName="English (US)" localName="English (US)" lcid="" culture="en-US">
      <area alias="sections">
        <key alias="Surcharges">Surcharges</key>
      </area>
    </language>
    

    then you should 'lose the square brackets'

    regards

    marc

  • Alastair Gordon 7 posts 107 karma points
    Apr 01, 2019 @ 10:54
    Alastair Gordon
    0

    Hi Marc,

    Thanks for the response. It's still stuck with [] though!

    So, I've now got a folder structure like:

    enter image description here

    The package.manifest looks like:

    { "dashboards": [ { "alias": "Surcharges", "sections": ["settings"] } ] }
    

    and the en-US.xml file is:

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <language alias="en" intName="English (US)" localName="English (US)" lcid="" culture="en-US">
      <area alias="sections">
        <key alias="Surcharges">Surcharges</key>
      </area>
    </language>
    

    and I still get:

    enter image description here

    Ideally I'd like a whole section up here:

    enter image description here

    But that can wait... ;)

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Apr 01, 2019 @ 12:09
    Warren Buckley
    102

    Hi Alastair
    Marc is close but the key's are slightly wrong

    https://github.com/umbraco/Umbraco-CMS/blob/v8/dev/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml#L2119-L2130

    So the area with the alias sections needs to change as following

    <area alias="dashboardTabs">
    

    Then that should work.

    Cheers,
    Warren :)

  • Alastair Gordon 7 posts 107 karma points
    Apr 01, 2019 @ 12:20
    Alastair Gordon
    0

    Thanks Warren! Much appreciated! :D

    Thanks also to Marc for getting me closer than I was before his original reply!

Please Sign in or register to post replies

Write your reply to:

Draft