Kodi Community Forum

Full Version: simple as possible extra menu items Estuary
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
trying to make this as simple as possible for the kodi wiki

how the menu and widget screen are linked

<item>
<label>$LOCALIZE[1]</label>
<onclick>ActivateWindow(Pictures)</onclick>
<property name="menu_id">$NUMBER[4000]</property>
<thumb>icons/sidemenu/pictures.png</thumb>
<property name="id">pictures</property>
<visible>!Skin.HasSetting(HomeMenuNoPicturesButton)</visible>
</item>
right screen
<control type="group" id="4000">
     <visible>String.IsEqual(Container(9000).ListItem.Property(id),pictures)</visible>
     <include content="Visible_Right_Delayed">
      <param name="id" value="pictures"/>
     </include>
     <control type="grouplist" id="4001">
      <include>WidgetGroupListCommon</include>
      <include content="WidgetListCategories" condition="!Skin.HasSetting(HomeMenuNoPicturesButton)">
       <param name="content_path" value="sources://pictures/"/>
       <param name="widget_header" value="$LOCALIZE[20094]"/>
       <param name="widget_target" value="pictures"/>
       <param name="list_id" value="4100"/>
       <param name="icon_height" value="110"/>
      </include>
     </control>
     
    </control>
<item> menu item tag
    <label>$LOCALIZE[1]</label> name of menu in this one it is = to pictures
    <property name="menu_id">$NUMBER[4000]</property> this is the number linked to the groups
    <control type="group" id="4000"> <control type="grouplist" id="4001"> <param name="list_id" value="4100"/>
    <onclick>ActivateWindow(Pictures)</onclick> ActivateWindow or plugin or node
    <thumb>icons/sidemenu/pictures.png</thumb> image thumb icon
    <property name="id">pictures</property> is the same
<visible>String.IsEqual(Container(9000).ListItem.Property(id),pictures)</visible>
    and <param name="id" value="pictures"/>
    <visible>!Skin.HasSetting(HomeMenuNoPicturesButton)</visible> not needed unless you are going to hide it
    </item> close item tag
    missing from pictures but needed for widget rows is <pagecontrol>menu_id010</pagecontrol> and it uses the same menu_id 010
    and and is placed after  <include>WidgetGroupListCommon</include> and after widget rows is <include content="WidgetScrollbar" condition="Skin.HasSetting(touchmode)">
      <param name="scrollbar_id" value="menu_id010"/>
     </include>

Example of how this works kids zone edit home.xml

 <item>
               <label>kids zone</label>
               <onclick>ActivateWindow(10025,&quot;plugin://plugin.video.youtube/kodion/search/list/&quot;,return)</onclick>
              <property name="menu_id">$NUMBER[30000]</property>
              <thumb>icons/sidemenu/kids.png</thumb>
             <property name="id">kidszone</property>
             </item>

Image
    
 <control type="group" id="21000"> add before <control type="group" id="30000">
     <visible>String.IsEqual(Container(9000).ListItem.Property(id),kidszone)</visible>
     <include content="Visible_Right_Delayed">
      <param name="id" value="kidszone"/>
     </include>
     <control type="grouplist" id="30001">
      <include>WidgetGroupListCommon</include>
      <pagecontrol>30010</pagecontrol>
      Widgets can be added from a node (library://video/movies/) see kodi node library examples 344482 (thread)
      
      <include content="WidgetListPoster" condition="Library.HasContent(movies)">
       <param name="content_path" value="special://skin/playlists/unwatched_movies.xsp"/>
       <param name="widget_header" value="$LOCALIZE[31007]"/>
       <param name="widget_target" value="videos"/>
       <param name="list_id" value="30300"/>
      </include>
      <include content="WidgetListPoster" condition="Library.HasContent(movies)">
       <param name="content_path" value="special://skin/playlists/random_movies.xsp"/>
       <param name="widget_header" value="$LOCALIZE[31006]"/>
       <param name="widget_target" value="videos"/>
       <param name="list_id" value="30400"/>
      </include>
      </control>
      <include content="WidgetScrollbar" condition="Skin.HasSetting(touchmode)">
      <param name="scrollbar_id" value="5010"/>
     </include>
     </control>

content screen
Image

the <param name="list_id" value="30300"/> of the next widget needs to be higher then the one before <param name="list_id" value="30310"/>
thanks for this , is a big help.
@the_other_guy 

Are the movies under "Kids Zone" located in an own folder? Or how are you filtering?
located in an own folder? Or how are you filtering?
the best way is to make a node
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="40" type="folder">
    <label>Other Movies</label>
    <icon>DefaultFolder.png</icon>
    <path>D:\videos</path>
</node>

this can be done with addons library node editor
to link a widget to a node

<include content="WidgetListPoster" >
                        <param name="content_path" value="library://video/widgets/kids/row1/row1.xml"/>
                        <param name="widget_header" value="row1"/>
                        <param name="widget_target" value="videos"/>
                        <param name="list_id" value="27100"/>
                       </include>
library://video/ your link

to add to menu add node to favourites open favourites.xml you will get a link like 
<favourite name="row1">ActivateWindow(10025,&quot;library://video/widgets/kids/row1/&quot;,return)</favourite>
</favourites>

<item> <label>kids zone</label> <onclick>ActivateWindow(10025,&quot;plugin://plugin.video.youtube/kodion/search/list/&quot;,return)</onclick> <property name="menu_id">$NUMBER[30000]</property> <thumb>icons/sidemenu/kids.png</thumb> <property name="id">kidszone</property> </item>

ActivateWindow(10025,&quot;plugin://plugin.video.youtube/kodion/search/list/&quot;,return) replace with ActivateWindow(10025,&quot;library://video/widgets/kids/row1/&quot;,return) from favourites
(2019-07-15, 14:10)the_other_guy Wrote: [ -> ]the best way is to make a node
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<node order="40" type="folder">
    <label>Other Movies</label>
    <icon>DefaultFolder.png</icon>
    <path>D:\videos</path>
</node>
Is that a file I need to create, and if so, what file name should it have?
Will the movies in this folder be mixed up with the ones shown under Movies from the menu? Separating the two is crucial.

Maybe you can demo this with a video that you can upload to youtube? Its a little hard to follow.
<label>row1</label>
<param name="widget_header" value="row1"/>
ActivateWindow(10025,&quot;library://video/widgets/kids/row1/&quot;,return)

they can be any name as long as they match on all 3 lines
@the_other_guy 
Is there a way to get default library views (Fanart) and movie info with <onclick> without scraping to the library?
This is cool! Add/scrape to library and use playlists. Thanks the_other_guy Smile