Customize Home menu
#1
The confluence skin looks great! I was just starting to look at customizing Redux when this appeared. I need to customize the main menu to help the WAF. Namely, I want to add a "kids movies" menu item that would go to a sub-folder with just the kids movies, and a "hulu" one that would go directly to a hulu plugin. I am looking at the home.xml and trying to understand the changes needed, but I would appreciate any suggestions.

Thanks!
Reply
#2
You need to edit 720p\home.xml starting at line 788 in side the <content> bits
Reply
#3
Ronie in his Trasparency! skin probably has the best explanation on how to change/add home menu buttons. Obviously that guide is geared towards his skin but the concepts are the same.

Check this link....http://forum.xbmc.org/showpost.php?p=411326&postcount=7
Reply
#4
I'm no stranger to adding or changing items in the sub-menus that exist, but How can I make a new sub-menu for 'programs' to add things like, email, web browsing and etc. for my wife? I know how to do the code for the actual items, I'm just not sure how to get the initial sub-menu setup where there isn't one already. I did in in MediaStream, but the Confluence code is a bit too different for me to comprehend all the way yet.

EDIT:
I got it all sorted out. I got the sub-menu added with the items I needed and even the little sub-menu indicator added.
Reply
#5
kricker Wrote:I'm no stranger to adding or changing items in the sub-menus that exist, but How can I make a new sub-menu for 'programs' to add things like, email, web browsing and etc. for my wife? I know how to do the code for the actual items, I'm just not sure how to get the initial sub-menu setup where there isn't one already. I did in in MediaStream, but the Confluence code is a bit too different for me to comprehend all the way yet.

EDIT:
I got it all sorted out. I got the sub-menu added with the items I needed and even the little sub-menu indicator added.

Please share Big Grin
Reply
#6
i would also like to know what you did to add a new menu!
do please tell!
Reply
#7
Okay, I have had a few PM regarding this, so here it goes. You'll need to modify Confluence\720p\home.xml to add/remove change home menu items.

FYI, when you upgrade the skin or XBMC (which currently includes the skin) your home.xml file will be overwritten. So after you make your edits, be sure to make a backup somewhere safe so you can re-apply your edits after such an upgrade.

I did all these edits on my own, hopefully JezzX will chime in if I did something blatantly wrong. The code for the page is broken down into groups of on screen items, so it is pretty easy to find what you need once you know what to look for. You'll see comments before some of these groups which look like:
Code:
<!-- Music Info -->
the <!-- opens a comment and the --> closes it. Anything between those tags is a comment and not considered code for the menu. You may want to add in your own comments. If you plan on removing menu items I recommend you do it with these comment notations so you can easily put the item back if you change your mind. I use Notepad++ to do my edits, which is nice because all the tags and comments are color coded making it easier to understand what you are looking at.

The submenu items for each main menu item start at:
Code:
<control type="group" id="9001">
For me this is line 396, but I have already done some editing which may have changed this line number slightly. Just use the search feature to fine the line of code above.

The main menu items starts with:
Code:
<content>
    <item id="8">
        <label>247</label>
        <onclick>ActivateWindow(Scripts)</onclick>
        <icon>special://skin/backgrounds/scripts.jpg</icon>
        <thumb>$INFO[Skin.String(Home_Custom_Back_Scripts_Folder)]</thumb>
        <visible>!Skin.HasSetting(HomeMenuNoScriptsButton)</visible>
    </item>
Anything you do to the main menu needs to stay between the <content> and </content> tags.

The whole main menu group actually starts at line 732:
Code:
<control type="fixedlist" id="9000">
You'll see reference to the id 9000 later.

I am not an XBMC skinner so I will explain these xml tags as I understand them.

item id="8"
I'm not sure exactly how item id's are used but each menu item should have it's own id. So if you add a new menu item, make sure it has it's own id number.

<label>247</label>
This is the text label you see for the item in the menu. The number relates to a specific word in the language string.xml files. This is so each language will see the proper translated word. I usually just type in the actual word I want to see as I am not worried about my menu items being used by a foreign language. For example I may make a menu item for internet applications and call it, <label>Web</label>.

<onclick>ActivateWindow(Scripts)</onclick>
This tells XBMC what to do when you select the menu item. You can actually stack multiple <onclick></onclick> actions to have XBMC do multiple things when you select the item. Just make a new line for each <onclick></onclick> action. In this case XBMC is going to open the Scripts screen. If you look through the home.xml file you'll see many of the native commands XBMC can execute. You can also look in the wiki for more commands. One I use a lot is;
Code:
<onclick>XBMC.System.Exec("D:\Communications\Firefox\firefox.exe" "https://mail.google.com/mail/" -p karl)</onclick>
XBMC.Sytem.Exec tells XBMC to launch an external application. When it does so, XBMC minimizes then restores itself when the external application is closed. In this case it launches Firefox with the extra parameter to use my profile.

<icon>special://skin/backgrounds/scripts.jpg</icon>
This is the image to use in a menu list that supports showing an icon. In this case of the main menu it is the default background image you see that changes.

<thumb>$INFO[Skin.String(Home_Custom_Back_Scripts_Folder)]</thumb>I am not sure about this, but I think this is based on the skin settings and covers over the default icon image set above when you choose a custom background image. If you are adding you own menu item chances are you wont need this line unless you plan on also editing the skins options. I'd recommend just copying another menu items <thumb> code that has similar images that could work for you new item.

<visible>!Skin.HasSetting(HomeMenuNoScriptsButton)</visible>This tells XBMC to show the menu item or not. If you leave out the <visible></visible> line the menu item will default to showing. I believe you can just put true, false, or as in this case, the value of a skin setting or other such code. You can see other code such as:
Code:
<visible>Library.HasContent(Music)</visible>
or
Code:
<visible>!Library.HasContent(Music)</visible>
These, I think show or hide the menu item based on if there is content in the music library. You'll find this code used in the sub-menu items.

Adding a new main menu item:
The easiest way to do it is to copy another menu items code from <item> to </item>. The menu items show up in the order they are in the code, so insert it where you want to see it. Make sure you change the item id to a new unused number. Then edited the other lines as needed.


Adding the sub-menu arrow graphic (the little arrow indicating there is a submenu).
Starting at line 777 you'll see:
Code:
                    <control type="image">
                        <posx>370</posx>
                        <posy>63</posy>
                        <width>18</width>
                        <height>18</height>
                        <texture>HomeHasSub.png</texture>
                        <visible>Container(9000).HasFocus(2) | Container(9000).HasFocus(3) | Container(9000).HasFocus(5) | Container(9000).HasFocus(7) | Container(9000).HasFocus(9) | [Container(9000).HasFocus(8) + [[Skin.HasSetting(HomeScriptButton1) + !IsEmpty(Skin.String(HomeScriptButton1_label))] | [Skin.HasSetting(HomeScriptButton2) + !IsEmpty(Skin.String(HomeScriptButton2_label))] | [Skin.HasSetting(HomeScriptButton3) + !IsEmpty(Skin.String(HomeScriptButton3_label))] | [Skin.HasSetting(HomeScriptButton4) + !IsEmpty(Skin.String(HomeScriptButton4_label))] | [Skin.HasSetting(HomeScriptButton5) + !IsEmpty(Skin.String(HomeScriptButton5_label))] | [Skin.HasSetting(HomeScriptButton6) + !IsEmpty(Skin.String(HomeScriptButton6_label))]]] | Container(9000).HasFocus(10) | Container(9000).HasFocus(11)</visible>
                        <animation effect="fade" start="0" end="100" time="200">Focus</animation>
                        <animation effect="fade" start="100" end="0" time="200">UnFocus</animation>
                    </control>
Line 783 with the <visible></visible> tags tell the graphic when to show up. The various conditions are seperated with the | symbol. The first one is Container(9000).HasFocus(2), which says when the item id of 2 in the control list 9000 is focused, the graphic will show. The main menu control is 9000 (I told you earlier you'd see these number again). So for this code when the main menu item "video" is focused you will see the graphic. I added | Container(9000).HasFocus(1) to my list of conditionals as I added sub-menu items to Programs.

continued at post #11.
Reply
#8
pseudoheld Wrote:i would also like to know what you did to add a new menu!
do please tell!

* edit 720p/Home.xml

at line 788 (or wherever you want)

Code:
<item id="8">
                                              <label>31329</label>
                                                <onclick>XBMC.ActivateWindow(MyVideoFiles,plugin://video/Hulu)</onclick>
                                                <icon>special://skin/backgrounds/Hulu.jpg</icon>
                                                <thumb>$INFO[Skin.String(Home_Custom_Back_Hulu_Folder)]</thumb>
                                                <visible>!Skin.HasSetting(HomeMenuNoHuluButton)</visible>
                                        </item>

* edit ./language/English/strings.xml - after line 124 add something like

<string id="31329">Hulu</string>

* Find a 1280 * 720 Hulu image abd put it in /backgrounds/Hulu.jpg
Reply
#9
thanks for the reply but i want to do something different than load a plugin and i just cant figure out how to.
i have the menu link and all setup. what i want to happen when i click on it is load up a MovieDatabase/Library from a different profile to display the movies (in this case sports events) that have been scraped by it.
i want this because i dont want my sports showing up in my main library but i dont want to keep switching profiles to get at the different things.
so if someone could tell me specifically how to open a database from a different profile i would be ever so glad!
Reply
#10
How can you make a submenu button send you to a specific playlist?
I tried this:
Code:
<onclick>ActivateWindow(VideoLibrary,special://videoplaylists/Awesome Shows,return)</onclick>
but It only sent me to the videoplaylist selection page. Huh
Reply
#11
..continued from the other post as it was getting too long.

Adding sub-menu items;
Starting at line 658 you can find the code for the TVshows sub menu items:
Code:
<control type="grouplist" id="9017">
    <posx>10</posx>
    <posy>0</posy>
    <width>240</width>
    <height>240</height>
    <align>center</align>
    <onleft>9000</onleft>
    <onright>Control.SetFocus(8001,0)</onright>
    <onup>9017</onup>
    <ondown>9017</ondown>
    <itemgap>0</itemgap>
    <visible>Container(9000).HasFocus(11)</visible>
    <control type="button" id="90171">
        <include>ButtonHomeSubCommonValues</include>
        <label>369</label>
        <onclick>ActivateWindow(VideoLibrary,TVShowTitles,return)</onclick>
    </control>
    <control type="button" id="90172">
        <include>ButtonHomeSubCommonValues</include>
        <label>135</label>
        <onclick>ActivateWindow(VideoLibrary,TVShowGenres,return)</onclick>
    </control>
    <control type="button" id="90173">
        <include>ButtonHomeSubCommonValues</include>
        <label>652</label>
        <onclick>ActivateWindow(VideoLibrary,TVShowYears,return)</onclick>
    </control>
    <control type="button" id="90174">
        <include>ButtonHomeSubCommonValues</include>
        <label>344</label>
        <onclick>ActivateWindow(VideoLibrary,TVShowActors,return)</onclick>
    </control>
    <control type="button" id="90175">
        <include>ButtonHomeSubCommonValues</include>
        <label>31328</label>
        <onclick>ActivateWindow(VideoLibrary,RecentlyAddedEpisodes,return)</onclick>
    </control>
</control>
How'd I know that was the code for the TVshows sub-menu items? I figured it out based on the <onclick> actions code. You can also see on the <visible> line it references the container 9000 and id number 11, which is the "TV Shows" main menu item. This is also the last block of sub-menu code. All the others are above it.

To add sub-menu items to Programs what I did was copy the TV Shows menu code above and pasted it back in right below itself. Make sure you paste it on a new line after the </control> on line 695. Then make sure you change the id on the first line of pasted code from 9017 to something else. I used 9018 as it seemed the logical choice. To confirm though, I scrolled up through the code for the other submenus to make sure that number was not already used. Then you will start editing the other lines starting with the <onleft> tag.

<onleft>9000</onleft>
What control gets focus when you navigate to the left of the sub-menu. Here the control changes back to the main menu, which if you remember was id 9000.

<onright>Control.SetFocus(8001,0)</onright>
What control gets focus when you navigate to the right of the sub-menu. Here the control changes to the recently added TVShow widget on the right, focusing the first item in the list. For my Programs submenu, there is no recently added widget so I changed it to be just like the <onleft> tag and put the value 9000 there.

<onup>9017</onup>
What control gets focus when you navigate up from the sub-menu. Here it just stays on itself, as 9017 is the id for the TV Show sub-menu. Since above I changed the sub-menu id to be 9018 for Programs I need to change the value here to 9018 as well.

<ondown>9017</ondown>
What control gets focus when you navigate down from the sub-menu. Here it just stays on itself, as 9017 is the id for the TV Show sub-menu. Since above I changed the sub-menu id to be 9018 for Programs I need to change the value here to 9018 as well.

<visible>Container(9000).HasFocus(11)</visible>
This tells the sub-menu when to show up. Make sure you edit the HasFocus(#) to match the main menu item that relates to this. For my purposes it was id 1. Remeber you can find this number by looking in the code block for the main menu items.

<control type="button" id="90171">
<include>ButtonHomeSubCommonValues</include>
<label>369</label>
<onclick>ActivateWindow(VideoLibrary,TVShowTitles,return)</onclick>
</control>

There are groups of these blocks of code. They are the items in the sub menu. Just keep however many of these blocks of code as you need and edit them to your liking. The descriptions of the <label> and <onclick> tags I already went over. You shouldn't need to change the <include> tag. The only other thing you need to pay attention to is the id="#" on the first line. Each one should be an independent number. The pattern used seems to be take the first 4 digits from the sub-menus id then add the last digit and number up. So for my sub-menu items I started at 90181 then numbered each item up from there. 9018 was the id I changed my sub-menu too if you remember.

I ended up with the following code:
Code:
<control type="grouplist" id="9018">
    <posx>10</posx>
    <posy>0</posy>
    <width>240</width>
    <height>240</height>
    <align>center</align>
    <onleft>9000</onleft>
    <onright>9000</onright>
    <onup>9018</onup>
    <ondown>9018</ondown>
    <itemgap>0</itemgap>
    <visible>Container(9000).HasFocus(1)</visible>
    <control type="button" id="90181">
        <include>ButtonHomeSubCommonValues</include>
        <label>Browse Web</label>
        <onclick>XBMC.System.Exec("D:\Communications\Firefox\firefox.exe")</onclick>
    </control>
    <control type="button" id="90182">
        <include>ButtonHomeSubCommonValues</include>
        <label>E-mail</label>
        <onclick>XBMC.System.Exec("D:\Communications\Firefox\firefox.exe" "https://mail.google.com/mail/" -p karl)</onclick>
    </control>
    <control type="button" id="90183">
        <include>ButtonHomeSubCommonValues</include>
        <label>PBS Kids</label>
        <onclick>XBMC.System.Exec("D:\Communications\Firefox\firefox.exe" "http;//pbskids.org/")</onclick>
    </control>
</control>
This gives me sub-menu items for browsing the web, checking my email (using firefox and Gmail), and going to PBSKids.org to play games for my son.
Reply
#12
Quote:FYI, when you upgrade the skin or XBMC (which currently includes the skin) your home.xml file will be overwritten. So after you make your edits, be sure to make a backup somewhere safe so you can re-apply your edits after such an upgrade.
surely the best place is to copy the skin to ~/.xbmc/skin and edit there to avoid distribution updates removing changes, it's what I do
Reply
#13
kricker Wrote:..continued from the other post as it was getting too long.

Adding sub-menu items;
Starting at line 658 you can find the code for the TVshows sub menu items:
Code:
<control type="grouplist" id="9017">
    <posx>10</posx>
    <posy>0</posy>
    <width>240</width>
    <height>240</height>
    <align>center</align>
    <onleft>9000</onleft>
    <onright>Control.SetFocus(8001,0)</onright>
    <onup>9017</onup>
    <ondown>9017</ondown>
    <itemgap>0</itemgap>
    <visible>Container(9000).HasFocus(11)</visible>
    <control type="button" id="90171">
        <include>ButtonHomeSubCommonValues</include>
        <label>369</label>
        <onclick>ActivateWindow(VideoLibrary,TVShowTitles,return)</onclick>
    </control>
    <control type="button" id="90172">
        <include>ButtonHomeSubCommonValues</include>
        <label>135</label>
        <onclick>ActivateWindow(VideoLibrary,TVShowGenres,return)</onclick>
    </control>
    <control type="button" id="90173">
        <include>ButtonHomeSubCommonValues</include>
        <label>652</label>
        <onclick>ActivateWindow(VideoLibrary,TVShowYears,return)</onclick>
    </control>
    <control type="button" id="90174">
        <include>ButtonHomeSubCommonValues</include>
        <label>344</label>
        <onclick>ActivateWindow(VideoLibrary,TVShowActors,return)</onclick>
    </control>
    <control type="button" id="90175">
        <include>ButtonHomeSubCommonValues</include>
        <label>31328</label>
        <onclick>ActivateWindow(VideoLibrary,RecentlyAddedEpisodes,return)</onclick>
    </control>
</control>
How'd I know that was the code for the TVshows sub-menu items? I figured it out based on the <onclick> actions code. You can also see on the <visible> line it references the container 9000 and id number 11, which is the "TV Shows" main menu item. This is also the last block of sub-menu code. All the others are above it.

To add sub-menu items to Programs what I did was copy the TV Shows menu code above and pasted it back in right below itself. Make sure you paste it on a new line after the </control> on line 695. Then make sure you change the id on the first line of pasted code from 9017 to something else. I used 9018 as it seemed the logical choice. To confirm though, I scrolled up through the code for the other submenus to make sure that number was not already used. Then you will start editing the other lines starting with the <onleft> tag.

<onleft>9000</onleft>
What control gets focus when you navigate to the left of the sub-menu. Here the control changes back to the main menu, which if you remember was id 9000.

<onright>Control.SetFocus(8001,0)</onright>
What control gets focus when you navigate to the right of the sub-menu. Here the control changes to the recently added TVShow widget on the right, focusing the first item in the list. For my Programs submenu, there is no recently added widget so I changed it to be just like the <onleft> tag and put the value 9000 there.

<onup>9017</onup>
What control gets focus when you navigate up from the sub-menu. Here it just stays on itself, as 9017 is the id for the TV Show sub-menu. Since above I changed the sub-menu id to be 9018 for Programs I need to change the value here to 9018 as well.

<ondown>9017</ondown>
What control gets focus when you navigate down from the sub-menu. Here it just stays on itself, as 9017 is the id for the TV Show sub-menu. Since above I changed the sub-menu id to be 9018 for Programs I need to change the value here to 9018 as well.

<visible>Container(9000).HasFocus(11)</visible>
This tells the sub-menu when to show up. Make sure you edit the HasFocus(#) to match the main menu item that relates to this. For my purposes it was id 1. Remeber you can find this number by looking in the code block for the main menu items.

<control type="button" id="90171">
<include>ButtonHomeSubCommonValues</include>
<label>369</label>
<onclick>ActivateWindow(VideoLibrary,TVShowTitles,return)</onclick>
</control>

There are groups of these blocks of code. They are the items in the sub menu. Just keep however many of these blocks of code as you need and edit them to your liking. The descriptions of the <label> and <onclick> tags I already went over. You shouldn't need to change the <include> tag. The only other thing you need to pay attention to is the id="#" on the first line. Each one should be an independant number. The pattern used seems to be take the first 4 digits from the submenus id then add the last digit and number up. So for my sub-menu items I started at 90181 then numberd each item up from there. 9018 was the id I changed my sub-menu too if you remember.

I ended up with the following code:
Code:
<control type="grouplist" id="9018">
    <posx>10</posx>
    <posy>0</posy>
    <width>240</width>
    <height>240</height>
    <align>center</align>
    <onleft>9000</onleft>
    <onright>9000</onright>
    <onup>9018</onup>
    <ondown>9018</ondown>
    <itemgap>0</itemgap>
    <visible>Container(9000).HasFocus(1)</visible>
    <control type="button" id="90181">
        <include>ButtonHomeSubCommonValues</include>
        <label>Browse Web</label>
        <onclick>XBMC.System.Exec("D:\Communications\Firefox\firefox.exe")</onclick>
    </control>
    <control type="button" id="90182">
        <include>ButtonHomeSubCommonValues</include>
        <label>E-mail</label>
        <onclick>XBMC.System.Exec("D:\Communications\Firefox\firefox.exe" "https://mail.google.com/mail/" -p karl)</onclick>
    </control>
    <control type="button" id="90183">
        <include>ButtonHomeSubCommonValues</include>
        <label>PBS Kids</label>
        <onclick>XBMC.System.Exec("D:\Communications\Firefox\firefox.exe" "http;//pbskids.org/")</onclick>
    </control>
</control>
This gives me sub-menu items for browsing the web, checking my email (using firefox and Gmail), and going to PBSKids.org to play games for my son.

AWESOME POST!!! Big Grin Thanks Dude!
Reply
#14
This works great, I have it set to launch MythTV, but how do you restore XBMC after you quit firefox? I really want to do this only via remove (no mouse, keyboard)

Is there a command to tell XBMC to refocus itself (fullscreen)?
Reply
#15
Using the code I posted, XBMC will restore itself whenever an app it launched has closed. Closed, not minimized. I would think it re-gains focus all on it's own. I use Eventghost on windows. It makes sure XBMC is receiving the remote commands when it is on top.
Reply

Logout Mark Read Team Forum Stats Members Help
Customize Home menu1