Copied to clipboard

Flag this post as spam?

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


  • Phill 115 posts 288 karma points
    Feb 18, 2016 @ 14:30
    Phill
    0

    Custom Section Text and Labels

    Hi there,

    I seem to be having the exact same issue that Nigel posted a couple years ago in attempting to create a plugin that has it's own section/tree/dashboard etc. However my solution isn't a type as he discovered and I'm having a heck of a time trying to find any docs that go into any kind of detail when it comes to creating a plugin with custom section. Most samples that i'm able to dig up are 1-2 years old and copied line by line give me the same issue.

    The issue is as per Nigel's screen shots seen here: https://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/50103-Custom-Section-Headings

    The section name below the icon is [MyPluginName] and I've tried creating en.xml, en-GB.xml files in a Lang folder under the plugin, I've added this to the Config/Lang files there and also the Umbraco/Config/Lang/en.xml file and no matter what I do this text is always displayed as the [MyPluginName] or [sections_MyPluginName]

    Any help in where to look to trouble shoot this issue would be greatly appreciated. I would think that if my plugin has no need to be translated that I wouldn't even need to touch any of the lang xml files. I don't see any errors in log files or in browser dev console either (other than ongoing gravatar error).

    Thanks in advance! Phill

  • Phill 115 posts 288 karma points
    Feb 18, 2016 @ 16:20
    Phill
    2

    As I was about to give up on this and wait for a response, I finally stumbled on the solution (wish this stuff was documented or more up to date samples were available).

    Turns out I needed to have MyPluginName/lang/en-GB.xml (GB is my default lang) and then add the following:

    
    // This Works
      <area alias="sections">
        <key alias="MyPluginName">Test Test Working</key>
     </area>
    
    // This doesn't Work
      <area alias="MyPluginName">
        <key alias="MyPluginName">Test Text 1</key>
        <key alias="sections_MyPluginName">Test Text 2</key>
      </area>
    

    I would have thought (based on logic and other posts) that all language related to my Plugin would be under it's own "Area" but I guess not.

    I would still like to know why this is even necessary if I don't plan on translating the plugin (I haven't tested but I assume that if an en-US user visits the backend they will see [MyPuginName] if I don't create en-US.xml. Why doesn't the system pick up on the applications.config "name" value?

    Phill

  • Nigel Wilson 944 posts 2076 karma points
    Jan 16, 2017 @ 17:52
    Nigel Wilson
    0

    Hi Phill

    I am again having issues with a custom section and trying your solution hasn't solved it for me. So just wanted to check that the XML code quoted was the entire file and therefore is was not wrapped in a 'language' node as /umbraco/config/lang/en.xml

    Also I note the specific us language file uses an underscore whereas you have indicated a dash?

    Something seemingly so simple is proving so annoying.

    Cheers Nigel

  • Nigel Wilson 944 posts 2076 karma points
    Jan 16, 2017 @ 17:56
    Nigel Wilson
    0

    Arghhh - OK it seems your solution does in fact work - my issue related to Chrome and caching - have just tried incognito mode and things are working as expected (hoped).

    Upward and onward...

Please Sign in or register to post replies

Write your reply to:

Draft