4

According to Developing a MVC Component/Developing a Basic Component, proper place of setting Menu Section name is helloworld.xml file. Particularly

<administration>
    <!-- Administration Menu Section -->
    <menu link='index.php?option=com_helloworld'>Hello World!</menu>

But instead of having "Hello World!" I have "hello-world".
Maybe 'menu' tag has some attributes, which can help me set proper name for my Component?
I'm using Joomla! 3.4.3 Stable

EDIT1
I modified my helloworld.xml

<administration>
    <!-- Administration Menu Section -->
    <menu link='index.php?option=com_helloworld'>COM_HELLOWORLD_DISPLAY_MENU_NAME</menu>
    <menu view="viewname">COM_HELLOWORLD_DISPLAY_MENU_NAME</menu>

...

    <files>
    <folder>admin/language</folder>
  </files>

  <languages>
    <language tag="en-GB">admin/language/en-GB/en-GB.com_helloworld.sys.ini</language>
  </languages>

</extension>

en-GB.com_helloworld.sys.ini:

COM_HELLOWORLD_DISPLAY_MENU_NAME="Hello World menu item"


My understanding is, that I need to show Joomla where to copy language file. How to do this?

- folder
-- admin
--- language
---- en-GB
----- en-GB.com_helloworld.sys.ini
--- helloworld.php
-- site
--- helloworld.php
-- helloworld.xml

  • The Hello World! tutorial has a chapter on language files. I've noticed the same issue with the menu name, but if you ignore it for now and continue on the tutorial it sorts itself out after adding language strings in the corresponding chapter. – johanpw Jul 5 '15 at 13:49
3

The format you are using is normally associated with sub-menu's - I think the tutorial is incorrect/out of date — in our components the main administration menu item looks like this:

    <menu img="../media/com_componentName/images/icon.png">COM_COMPONENT_XML_NAME</menu>

I would recommend reading the article on Joomla Manifest files and the section on menus and sub-menus - it shows an example of the attributes required.

<menu>COM_EXAMPLE</menu>
<submenu>
    <!--
        Note that all & must be escaped to &amp; for the file to be valid
        XML and be parsed by the installer
    -->
    <menu link="anoption=avalue&amp;anoption1=avalue1">COM_EXAMPLE_SUBMENU_ANOPTION</menu>
    <menu view="viewname">COM_EXAMPLE_SUBMENU_VIEWNAME</menu>
</submenu>
  • I assume, it should be called as menu item. This item is situated under Components menu. It opens proper admin page (my page for my component). But the displayed name is not, what I was expecting. – Andrii Muzychuk Jul 5 '15 at 5:48
  • this is helping. Please, tell me how to specify language file so it is copied to administrator/language/en-GB It is copied only to language/en-GB – Andrii Muzychuk Jul 5 '15 at 6:21
  • This is really another question but since Joomla 1.6 language files (and the folder they're sorted in should remain inside your components folder - see docs.joomla.org/Manifest_files#Language_files – Craig Jul 5 '15 at 6:24
  • I saw this doc. It doesn't help me to name menu properly. – Andrii Muzychuk Jul 5 '15 at 6:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.