Kodi Community Forum

Full Version: adding custom submenu items
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2014-03-09, 02:22)denz Wrote: [ -> ]I will give a more detailed example first step is to open Includes.xml file that is located in skin.amber/1080i. You can use wordpad but notepad ++ is better for editing xml files.

First part is to add a menu to the home part and all the home menus are found underneath this section

<include name="Home.Main.Menu.Items">

Then lets use Custom3 as our base first copy it and paste it.

<item id="23" description="Custom3">
<visible>!IsEmpty(Skin.String(CustomHome.3.Path))</visible>
<label>$INFO[Skin.String(CustomHome.3.Label)]</label>
<thumb fallback="special://skin/backgrounds/default/default.jpg">$INFO[Skin.String(CustomHome.3.Background)]</thumb>
<onclick>$INFO[Skin.String(CustomHome.3.Path)]</onclick>
</item>

Lets make changes to this item

We need to change the id to something that has not been used before and as you can see I simplified the item removed visible tag and then you need to give action of what should that menu do in this example a notification pops up.

<item id="45" description="MyMenu1">
<label>MyMenu1</label>
<thumb fallback="special://skin/backgrounds/default/default.jpg"></thumb>
<onclick>Notification("test",0,1)</onclick>
</item>

So now that we the menu we need to add sub menus to do that we need to find the locations of sub menus and they are underneath this tag

<include name="Home.Submenu.Items">

Then similar to step one we will use existing menu as a base so this time I have chosen "Reload skin" so copy and paste this item

<item id="50" description="Reload skin">
<visible>Container(300).HasFocus(10)</visible>
<label>$LOCALIZE[20183]</label>
<onclick>XBMC.ReloadSkin()</onclick>
</item>

Now you need to give it a new id that doesn't exist. I have chosen 70 then in the visible section we need to change HasFocus(10) to the id we gave to the main menu which was 45. Then all that is left is to give the onclick action

<item id="70" description="MySubMenu1">
<visible>Container(300).HasFocus(45)</visible>
<label>Submenu1</label>
<onclick>Notification("test1",0,1)</onclick>
</item>


For the onclick action there heaps on xbmc forum

Hopefully this helps I am a newbie as well

I know this is over a year old, but I've been looking for ways to customize Amber and/or Aeon Nox, and this I just followed this ... it did add a menu item, but I'm not sure about sub menu ... either way this has made me realize the potential in customizing the Amber skin ... i'm going to play around with this more and see what else i can do! I mean following the general pattern here I may be able to figure it out. Any other resources or advice anyone can offer for this? Thanks so much to OP and @denz for posting this, super super super helpful!!! Impressive advice for being a 'newbie' at the time lol.
(2014-03-09, 02:22)denz Wrote: [ -> ]I will give a more detailed example first step is to open Includes.xml file that is located in skin.amber/1080i. You can use wordpad but notepad ++ is better for editing xml files.

First part is to add a menu to the home part and all the home menus are found underneath this section

<include name="Home.Main.Menu.Items">

Then lets use Custom3 as our base first copy it and paste it.

<item id="23" description="Custom3">
<visible>!IsEmpty(Skin.String(CustomHome.3.Path))</visible>
<label>$INFO[Skin.String(CustomHome.3.Label)]</label>
<thumb fallback="special://skin/backgrounds/default/default.jpg">$INFO[Skin.String(CustomHome.3.Background)]</thumb>
<onclick>$INFO[Skin.String(CustomHome.3.Path)]</onclick>
</item>

Lets make changes to this item

We need to change the id to something that has not been used before and as you can see I simplified the item removed visible tag and then you need to give action of what should that menu do in this example a notification pops up.

<item id="45" description="MyMenu1">
<label>MyMenu1</label>
<thumb fallback="special://skin/backgrounds/default/default.jpg"></thumb>
<onclick>Notification("test",0,1)</onclick>
</item>

So now that we the menu we need to add sub menus to do that we need to find the locations of sub menus and they are underneath this tag

<include name="Home.Submenu.Items">

Then similar to step one we will use existing menu as a base so this time I have chosen "Reload skin" so copy and paste this item

<item id="50" description="Reload skin">
<visible>Container(300).HasFocus(10)</visible>
<label>$LOCALIZE[20183]</label>
<onclick>XBMC.ReloadSkin()</onclick>
</item>

Now you need to give it a new id that doesn't exist. I have chosen 70 then in the visible section we need to change HasFocus(10) to the id we gave to the main menu which was 45. Then all that is left is to give the onclick action

<item id="70" description="MySubMenu1">
<visible>Container(300).HasFocus(45)</visible>
<label>Submenu1</label>
<onclick>Notification("test1",0,1)</onclick>
</item>


For the onclick action there heaps on xbmc forum

Hopefully this helps I am a newbie as well

I followed your guide and it works excellent, i got pointing to android apps(netflix and youtube) and have it pointing to addons (genesis, food network, nhl)
Unfortunately when i create sub menu to Phoenix... kodi loads to black screen. comment it out and it works fine. any ideas?

Code:
    <item id="80" description="MySubMenu80">
        <visible>Container(300).HasFocus(45) | Container(300).HasFocus(22) | Container(300).HasFocus(23) | Container(300).HasFocus(24)</visible>
        <label>Phoenix</label>
        <onclick>ActivateWindow(10025,&quot;plugin://plugin.video.phstreams/&quot;,return)</onclick>
    </item>
I've been flicking between the Aeon Nox skin and the Amber skin, and on the whole I prefer the Amber skin - mainly for the view options in TV Shows, but also it's a nice, quick, slick skin. However, Aeon does have a couple things over it, and the main one is the ability to customise the sub menus on the home shelf. The level of detail you can go into is awesome, and you can remove, add, and change the function of the submenus to really tailor them to your own needs. I'd love to see this ported to the Amber skin!
Great guide.

I've removed submenus that I don't need and created my own that point to smartplaylists.

<item id="72" description="Recently Added">
<visible>Container(300).HasFocus(26)</visible>
<label>Recently Added</label>
<onclick>ActivateWindow(Videos,special://userdata/playlists/video/Sci-Fi Recently Added.xsp,return)</onclick>
</item>

Image

Image
Pages: 1 2