Kodi Community Forum

Full Version: Trying to create custom menu item in Transparency...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi guys.

I'm trying to add one more custom menu item in Kodi with the Transperency skin. You see, I'm trying to keep my anime stuff outside of my normal TV shows and movies, so to that end, I have a bunch of smart playlists. Transparency includes three custom menu options, but this is where I run into a problem.

The stock movies and TV shows will show ALL your movies and TV shows, which means I need to remove them and use two custom menus with smart playlists that exclude my anime. So that's two of the custom menus taken up. Then I need to create the anime menu. Since Kodi doesn't allow you to show both movies and TV shows together in the one smart playlist, that means I'll need two separate menus, one for anime movies and one for anime series. That means I need two more custom menus, which is one too many for what Transparency supports.

Clearly, I'll need to edit the Includes_Home.xml file to add in my fourth custom menu. I've already tried this, and I don't know if all the guides I've found on this topic are badly out of date or something, but nothing has worked! I can't get a single sign from Kodi that I've edited the main menu, not even something like a broken menu! It looks exactly as it did before!

Here's a sample of my edit (I'm using the horizontal menu):

<include name="HomeVideosButton">
<item id="1">
<label>3</label>
<onclick>ActivateWindow(Videos,Files,return)</onclick>
<icon>special://skin/backgrounds/videos.jpg</icon>
<thumb>$INFO[Skin.String(Home_Custom_Back_Videos_Folder)]</thumb>
</item>
</include>
<item id="2">
<label>Anime Movies</label>
<onclick>ActivateWindow(10025,"special://profile/playlists/video/animemovies.xsp", return)</onclick>
<icon>/Pictures/Kodi Backgrounds/Anime/</icon>
</item>
<include name="HomeTVShowsButton">
<item id="3">
<label>20343</label>
<onclick>ActivateWindow(Videos,tvshowtitles,return)</onclick>
<include condition="!Skin.HasSetting(Home_TVShows_Fanart_Background)">home-tvshows-background</include>
<include condition="Skin.HasSetting(Home_TVShows_Fanart_Background)">home-tvshows-background-fanart</include>
</item>
</include>
<include name="HomeMusicVideosButton">
<item id="4">
<label>20389</label>
<onclick>ActivateWindow(Videos,musicvideotitles,return)</onclick>
<icon>special://skin/backgrounds/musicvideos.jpg</icon>
<thumb>$INFO[Skin.String(Home_Custom_Back_MusicVideos_Folder)]</thumb>
</item>
</include>

As you can see, I'm trying to replace the stock item 2 with a menu called "Anime Movies" and have it play my "animemovies" smart playlist when clicked. It should also display the fanart from my "anime" folder. As I said before, Kodi acts like it has no clue that I've edited the main menu. I feel like I could erase have the code and it would still look exactly the same!

Any clue as to how to solve this?
If Ronie has the time he might be kind, but this has been discussed in the past (way back) and at that time he gave instructions to a user for multiple custom buttons, you might have to dig until you can't dig no more, but it's in the forums... maybe 2-3 years back. Google spiders sometimes are quicker.
You mean this one?
http://forum.kodi.tv/showthread.php?pid=...3pid411326

That's one of the guides I'd already tried.
I don't think it was a guide, I remember something about unlimited buttons and scrolling, but perhaps it turned that way.. I did note in the FAQ

"also adding buttons to the vertical menu is a bit more tricky than adding it to the horizontal menu..." would (ab)using one of the existing buttons be an option? it's far easier to change the label and the action of an existing button than to create a new one."

Might a conversion of an existing button work?
Yeah, that's what I tried to do in the code above. Did I do it wrong?
You're really entering the world of the skinner and all I can do is point out the wiki's for that. Skinning tutorials (wiki) Skinning (wiki) Skinning Manual (wiki) with profusion of sub menu's, might one custom button "Anime" with subs suffice?
That's what I have at the moment, it works, but it's not ideal... I've read those wikis before, I feels like I'm doing it right, but it doesn't seem to be effecting Kodi at all. Arugh! All I needed is one more custom button option! There's not some way of editing Transparency to include one? That way, I could assign the smart playlist and background to it from the GUI.
Okay, I've had some success! I had zero success with trying to add a custom menu button, but I was able to edit the stock "TV Shows" button to display "TV Series" instead and break it so nothing happens when you click it. I was actually hoping to have it open my custom "tv series" smart playlist instead, but this was at least proof of concept. I copied some code I found that was suppose to make Kodi load a smart playlist and this does indeed work! I couldn't work out how to assign background art, so I just left the code as-is and assigned it via the Kodi GUI instead. Did the same to the stock Movies menu which FINALLY freed up two custom slots to make both my anime movies and anime series menus! I finally have "TV Series", "Movies", "Anime Movies" and "Anime Series" menu buttons that use smart playlists to keep their libraries separate! Hooray!

The final touch will be putting the buttons into alphabetical order! According to what I've read online, the order of the menu buttons is suppose to come from either:
A) The "item id=" number
B) The actual order as it appears in the Includes_Home.xml

I've tried both, but they're still not in order! I want it to go Anime Movies>Anime Series>Movies>TV Series>Videos>Add-ons>Settings. Here's the code:
<include name="HomeCustom1Button">
<item id="1">
<label>$INFO[Skin.String(Menu_Custom1.Label)]</label>
<onclick>$INFO[Skin.String(Menu_Custom1.Path)]</onclick>
<icon>special://skin/backgrounds/settings.jpg</icon>
<thumb>$INFO[Skin.String(Home_Custom_Back_Custom1_Folder)]</thumb>
</item>
</include>
<include name="HomeCustom2Button">
<item id="2">
<label>$INFO[Skin.String(Menu_Custom2.Label)]</label>
<onclick>$INFO[Skin.String(Menu_Custom2.Path)]</onclick>
<icon>special://skin/backgrounds/settings.jpg</icon>
<thumb>$INFO[Skin.String(Home_Custom_Back_Custom2_Folder)]</thumb>
</item>
</include>
<include name="HomeMoviesButton">
<item id="3">
<label>Movies</label>
<onclick>ActivateWindow(10025,"special://profile/playlists/video/Movies.xsp", return)</onclick>
<include condition="!Skin.HasSetting(Home_Movies_Fanart_Background)">home-movies-background</include>
<include condition="Skin.HasSetting(Home_Movies_Fanart_Background)">home-movies-background-fanart</include>
</item>
</include>
<include name="HomeTVShowsButton">
<item id="4">
<label>TV Series</label>
<onclick>ActivateWindow(10025,"special://profile/playlists/video/TV Series.xsp", return)</onclick>
<include condition="!Skin.HasSetting(Home_TVShows_Fanart_Background)">home-tvshows-background</include>
<include condition="Skin.HasSetting(Home_TVShows_Fanart_Background)">home-tvshows-background-fanart</include>
</item>
</include>
<include name="HomeVideosButton">
<item id="5">
<label>3</label>
<onclick>ActivateWindow(Videos,Files,return)</onclick>
<icon>special://skin/backgrounds/videos.jpg</icon>
<thumb>$INFO[Skin.String(Home_Custom_Back_Videos_Folder)]</thumb>
</item>
</include>
You might quit while you're ahead, changing the order of the buttons is definitely in the skinning realm, and Ronie has cautioned previously about that. Changing the background images for the button is within skin settings, but if you've changed the title of the button, it prolly still listed as the default.

BTW: try and keep long code to a paste bin and linked back to the thread.
Hmmm, you're probably right. Well, what I have now is an improvement over what I had before with the broken movie banner art with the overwhelming solution of having to make all the banner art myself. It would be nice if banner art became a thing on IMDB, since they look nice and TVDB already supports it.
Are you still interested in adding a button and changing the order? It's really easy, and I just noticed this thread.
(2016-09-29, 22:28)RyeHumor Wrote: [ -> ]Are you still interested in adding a button and changing the order? It's really easy, and I just noticed this thread.
Obviously there is interest, otherwise the question wouldn't have appeared. So instead of a small tease with 'It's really easy', let's have your solution, I'm sure Ronie will be amused and I will be flabbergasted.
First, I would like to apologize to the group if it sounded like I have attitude. We are anonymous here but in real life I am not like that at all. In the post directly above mine fireze considers quitting while he is ahead so I thought maybe he did, and no other members are a part of this thread.
So here goes.
I have the same situation only I'm following the MVC thread so my button would be for 3d movies rather than Anime, but it's the same thing
Start by copying and pasting your Includes_Home.xml files, just in case.

Define your button:

Open the Includes_Home.xml and around line 2630 or so you'll find the group of button definitions. Add your own here such as:

<include name="3dMoviesButton">
<item id="17">
<label>Cinema 3d</label>
<onclick>ActivateWindow(Videos,"special://profile/playlists/video/3d.xsp", return)</onclick>
<icon>special://skin/backgrounds/settings.jpg</icon>
<thumb>-</thumb>
</item>
</include>

Pick whatever you want for the background, label, etc.

Add your button:

At around line2260 you'll see the vertical menu set <include name="VerticalMenu">
Scroll down from there to the <content> set adn add your button
<content>
<include condition="!Skin.HasSetting(Menu_Videos)">HomeVideosButton</include>
<include condition="!Skin.HasSetting(Menu_Movies)">HomeMoviesButton</include>
<include>3dMoviesButton</include>
<include condition="!Skin.HasSetting(Menu_TVShows)">HomeTVShowsButton</include>
<include condition="Skin.HasSetting(Menu_MusicVideos)">HomeMusicVideosButton</include>
MORE CODE
</content>
I wanted my button to be displayed behind the movies button and while I am sure it's frowned upon, this group is where you re-order your buttons if you want to.

That's it.

Here's a snip of the results:
Image

Image
Mines a bit different because I have T! switch background sets for H or V menus.
Here's the result of clicking on the 3d button:
Image
Your button is a rogue so it won't appear in the settings:
Image
and of course when you update T! I imagine you will have to re-add your buttons.

A couple more things
Check my reputation.
It's probably not a good idea to display more than 15 buttons total.
You asked to add a button, not mod the skin, and this is a simple way to do it.
I apologize for sounding condescending it my first post.
Answering sarcasm with sarcasm probably makes you the person you rail against.
I think Ronie said it eloquently in one line http://forum.kodi.tv/showthread.php?tid=...pid1250397
There is no doubt that you all are professional programmers with an immense command of your craft, so if you say nudging a bit of code is a mod and not a tweak, then that's the way it is, it's a mod.
Pages: 1 2