XMBML Folder Trees: Difference between revisions
Jump to navigation
Jump to search
(moved from "XMBML Structure" page) |
No edit summary |
||
Line 1: | Line 1: | ||
= An XMB item tree = | = An XMB item tree = | ||
This is an example of an [[XMBML Structure]] composed by a main XMB item which will act as a folder opening up into 3 other XMB folder items. | |||
First create the root XMB item which acts as a folder | |||
{{Boxcode|content=<syntaxhighlight lang="xml"> | {{Boxcode|content=<syntaxhighlight lang="xml"> | ||
<View id=" | <View id="root"> | ||
<Attributes> | <Attributes> | ||
<Table key=" | <Table key="folder_tree_main"> | ||
<Pair key="icon_rsc"><String>tex_album_icon</String></Pair> | <Pair key="icon_rsc"><String>tex_album_icon</String></Pair> | ||
<Pair key="title"><String> | <Pair key="title"><String>Main folder, contains 3 subfolders</String></Pair> | ||
<Pair key="child"><String>segment</String></Pair> | <Pair key="child"><String>segment</String></Pair> | ||
</Table> | </Table> | ||
</Attributes> | </Attributes> | ||
<Items> | <Items> | ||
<Query class="type:x-xmb/folder-pixmap" key=" | <Query class="type:x-xmb/folder-pixmap" key="folder_tree_main" attr="folder_tree_main" src="#seg_folder_tree_main_container" /> | ||
</Items> | </Items> | ||
</View> | </View> | ||
Line 21: | Line 20: | ||
Important Notes: | Important Notes: | ||
* I've used "''<Query class="type:x-xmb/folder-pixmap"''" for <Items> sub-entry type as it is good for displaying menus. | * I've used "''<Query class="type:x-xmb/folder-pixmap"''" for <Items> sub-entry type as it is good for displaying menus. | ||
* The 'attr' in the <Items> sub-entry | * The 'attr' in the <Items> sub-entry is the same as the table key in Attributes, so those attributes are asociated | ||
* the 'src' is | * the 'src' is using the character # that works as a link to load another "view id" segment in the current .xml | ||
* the icon | * the 'icon_rsc' is the "default folder" icon loaded from a .rco (and available for all XMB columns) | ||
* 'title' | * 'title' is in plain text | ||
* 'child' is set as 'segment' so the XMB knows this item will subdivide into other XMB items | * 'child' is set as 'segment' so the XMB knows this item will subdivide into other XMB items | ||
In order to create a working XMB sub menu the root xmb item | In order to create a working XMB sub menu the root xmb item must have its 'src' linking to a "container" (its the best way to think about it) and not directly linking to XMB items in the sub menu.( If you do not do this when you select your root XMB item to display a sub menu, the 'output' or 'action' of the XMB items of the sub menu will be shown rather than the actual XMB items): | ||
{{Boxcode|content=<syntaxhighlight lang="xml"> | {{Boxcode|content=<syntaxhighlight lang="xml"> | ||
<View id=" | <View id="seg_folder_tree_main_container"> | ||
<Items> | <Items> | ||
<Query class="type:x-xmb/folder-pixmap" key=" | <Query class="type:x-xmb/folder-pixmap" key="whatever" src="#seg_folder_tree_main_contents" /> | ||
</Items> | </Items> | ||
</View> | </View> | ||
Line 39: | Line 38: | ||
Important Notes: | Important Notes: | ||
* This has no attributes as it simply acts as a contents container/linker | * This has no attributes as it simply acts as a contents container/linker | ||
*The key is just an identifyer, you can use any name | |||
Now to create the | Now to create the segment which holds the sub menu items: | ||
{{Boxcode|content=<syntaxhighlight lang="xml"> | {{Boxcode|content=<syntaxhighlight lang="xml"> | ||
<View id=" | <View id="seg_folder_tree_main_contents"> | ||
<Attributes> | <Attributes> | ||
<Table key=" | <Table key="folder_tree_subfolder_1"> | ||
<Pair key="icon_rsc"><String>tex_album_icon</String></Pair> | <Pair key="icon_rsc"><String>tex_album_icon</String></Pair> | ||
<Pair key="title"><String> | <Pair key="title"><String>Subfolder 1</String></Pair> | ||
<Pair key="str_noitem"><String>msg_error_no_file</String></Pair> | |||
<Pair key="str_noitem"><String> | |||
</Table> | </Table> | ||
<Table key=" | <Table key="folder_tree_subfolder_2"> | ||
<Pair key="icon_rsc"><String>tex_album_icon</String></Pair> | <Pair key="icon_rsc"><String>tex_album_icon</String></Pair> | ||
<Pair key="title"><String> | <Pair key="title"><String>Subfolder 2</String></Pair> | ||
<Pair key="str_noitem"><String>msg_error_no_file</String></Pair> | |||
<Pair key="str_noitem"><String> | |||
</Table> | </Table> | ||
<Table key=" | <Table key="folder_tree_subfolder_3"> | ||
<Pair key="icon_rsc"><String>tex_album_icon</String></Pair> | <Pair key="icon_rsc"><String>tex_album_icon</String></Pair> | ||
<Pair key="title"><String> | <Pair key="title"><String>Subfolder 3</String></Pair> | ||
<Pair key="str_noitem"><String>msg_error_no_file</String></Pair> | |||
<Pair key="str_noitem"><String> | |||
</Table> | </Table> | ||
</Attributes> | </Attributes> | ||
<Items> | <Items> | ||
<Query class="type:x-xmb/folder-pixmap" key=" | <Query class="type:x-xmb/folder-pixmap" key="folder_tree_subfolder_1" attr="folder_tree_subfolder_1" /> | ||
<Query class="type:x-xmb/folder-pixmap" key=" | <Query class="type:x-xmb/folder-pixmap" key="folder_tree_subfolder_2" attr="folder_tree_subfolder_2" /> | ||
<Query class="type:x-xmb/folder-pixmap" key=" | <Query class="type:x-xmb/folder-pixmap" key="folder_tree_subfolder_3" attr="folder_tree_subfolder_3" /> | ||
</Items> | </Items> | ||
</View> | </View> | ||
Line 75: | Line 72: | ||
* These are dummy items, they do not 'go anywhere' or perform any function. They will just print the str_noitem message when clicked because they have no function | * These are dummy items, they do not 'go anywhere' or perform any function. They will just print the str_noitem message when clicked because they have no function | ||
* notice how the <attr> from the <Items> sub entries matches the <Table keys> from the <Attributes> sub entries | * notice how the <attr> from the <Items> sub entries matches the <Table keys> from the <Attributes> sub entries | ||
{{System Firmware}}<noinclude>[[Category:Main]]</noinclude> | {{System Firmware}}<noinclude>[[Category:Main]]</noinclude> |
Revision as of 18:13, 15 October 2014
An XMB item tree
This is an example of an XMBML Structure composed by a main XMB item which will act as a folder opening up into 3 other XMB folder items.
First create the root XMB item which acts as a folder
Code Sample
Important Notes:
- I've used "<Query class="type:x-xmb/folder-pixmap"" for <Items> sub-entry type as it is good for displaying menus.
- The 'attr' in the <Items> sub-entry is the same as the table key in Attributes, so those attributes are asociated
- the 'src' is using the character # that works as a link to load another "view id" segment in the current .xml
- the 'icon_rsc' is the "default folder" icon loaded from a .rco (and available for all XMB columns)
- 'title' is in plain text
- 'child' is set as 'segment' so the XMB knows this item will subdivide into other XMB items
In order to create a working XMB sub menu the root xmb item must have its 'src' linking to a "container" (its the best way to think about it) and not directly linking to XMB items in the sub menu.( If you do not do this when you select your root XMB item to display a sub menu, the 'output' or 'action' of the XMB items of the sub menu will be shown rather than the actual XMB items):
Code Sample
Important Notes:
- This has no attributes as it simply acts as a contents container/linker
- The key is just an identifyer, you can use any name
Now to create the segment which holds the sub menu items:
Code Sample
Important Notes:
- These are dummy items, they do not 'go anywhere' or perform any function. They will just print the str_noitem message when clicked because they have no function
- notice how the <attr> from the <Items> sub entries matches the <Table keys> from the <Attributes> sub entries