|
Phoenix This forum is for discussing the user-created Phoenix custom interface for SageTV. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Edit Menus and Questions about Menus
This is not meant to be the "user guide" for editing menus, but for now, it hopefully it will serve as guidance for those wishing to customize the menus in Phoenix.
Phoenix menus are currently stored in STVs/Phoenix/Menus/ and there are number of menu files there. The names of the files are not important, but we've logically grouped them into
Take some time and browse the menus just to see a bit about the organization. Never edit the menus in the main STVs/Phoenix/Menus/ area, instead create a new menu file in the userdata/Phoenix/Menus/ area. For example, if you wanted to modify the LandingMenu, then you can copy the existing STVs/Phoenix/Menus/LandingMenu.xml to userdata/Phoenix/Menus/LandingMenu.xml, and edit that file. We will constantly update and overwrite the main xml files, so never edit those, but rather copy to the userdata area, and edit from there. I can't stress this enough If you are familiar with nielm's Dynamic Menus, then our menus are similar, but NOT the same. Each menu is defined in a <menu> tag, and menu can contain <menuItem>, <menu> and <view> children. When you define a <menu> or <view> as a child then it becomes a submenu. <menu> Attributes
A <menu> can have <menuItem> or <menu> children. <menuItem> Attributes
A <menuItem> can have several actions. Actions are perfomed on a <menuItem> when a user selects an item. The following actions are supported
Adding New Menu Items Phoenix uses "fragments" to contribute menu items (or complete menus) to other existing menus. So, if you needed to add a new menu to the landing zone, you'd create a fragment that contributes a new item. If you want to replace an item in the landing zone, for example, "TV", then create a new fragment for your new menu item, and then hide the core one. A menu fragment must be stored in an xml file in the userdata/Phoenix/Menus/ directory. The filename is not important, but the structure must be like the following... Code:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE menus SYSTEM "menus.dtd"> <menus> <fragment parentMenu="phoenix.menu.lz.videos" insertBefore="phoenix.menu.lz.videos.blueraydefaultbrowser"> <menuItem name="MC_Movie_Archive_Menu" label="Archived Movies" visible="true"> <description>Archived Movies</description> <eval>AddGlobalContext("DefaultView","MC_Movie_Archive")</eval> <screen name="Phoenix Universal Media Browser" /> </menuItem> </fragment> </menus> the <menuItem> is your complete menu item definition. After you add new menu items, you must reload the menus for the new file to be picked up. You can have multiple <fragment> elements per menu file. Some Examples Menu Item that launches the Phoenix UMB for a given view name (view names are defined in the vfs.xml) Code:
<menuItem name="browse" label="Browse TV" visible="true" icon="gTVMenuIcon"> <eval>AddGlobalContext( "DefaultView" , "tvrecentactivity" )</eval> <screen name="Phoenix Universal Media Browser" /> </menuItem> Code:
<menuItem name="customitem.command.firefox" label="Run Firefox"> <exec cmd="C:\Program Files\Mozilla Firefox\firefox.exe" /> </menuItem> Code:
<menuItem label="Horizontal" visible="true"> <eval>phoenix_config_SetUserProperty("LandingZone", "Horizontal")</eval> <screen name="Phoenix Landing Zone"/> </menuItem> Code:
<menu name="PhoenixUMB-SingleList" label="Universal Media Browser Options" background="OptionsMenuBackground.jpg" type="TV"> <description>"Context Sensitive Menu"</description> <menuItem label="${"List Search Mode: " + phoenix_api_GetUserProperty( "listSearchMethod" , "Percent" )}" visible="true"> <eval>phoenix_api_SetUserProperty( "listSearchMethod", If(phoenix_api_GetUserProperty( "listSearchMethod" , "Percent" ) == "Percent" , "RegEx", "Percent") )</eval> <eval>Refresh()</eval> </menuItem> <menu name="DefaultUMB" label="Select Default Browser" background="OptionsMenuBackground.jpg" type="TV" visible="true"> <menuItem label="Single List" visible="true"> <eval>AddStaticContext( "DefaultView" , CurrentViewName )</eval> <eval>phoenix_config_SetUserProperty("DefaultUMB", "SingleList")</eval> <screen name="Phoenix Universal Media Browser"/> </menuItem> <menuItem label="Double List" visible="true"> <eval>AddStaticContext( "DefaultView" , CurrentViewName )</eval> <eval>phoenix_config_SetUserProperty("DefaultUMB", "DoubleList")</eval> <screen name="Phoenix Universal Media Browser"/> </menuItem> <menuItem label="Horizontal List" visible="true"> <eval>AddStaticContext( "DefaultView" , CurrentViewName )</eval> <eval>phoenix_config_SetUserProperty("DefaultUMB", "HorizontalList")</eval> <screen name="Phoenix Universal Media Browser"/> </menuItem> </menu> <menuItem label="Change Media View" visible="true"> <eval>AddGlobalContext( "OptionsSubmenu" , "View Selector" )</eval> <eval>Refresh()</eval> </menuItem> </menu> Code:
<menuItem label="${"List Search Mode: " + phoenix_api_GetUserProperty( "listSearchMethod" , "Percent" )}" visible="true"/> Code:
<menuItem lable="Advanced Views" visible="prop:client:phoenix/vfs/advancedViewsEnabled"/> Menu that built using a view Code:
<view name="lz_featuredfavorite" label="Featured" contextVar="MediaFile" preload="true" limit="6"> <eval>Watch(phoenix_media_GetSageMediaFile(MediaFile))</eval> <screen name="Phoenix MediaPlayer OSD" /> </view> Also, keep in mind that for now, if you change the menus, then you'll need to use BMT (Configure -> Refresh Configurations) to reload the menus. We will, at some point offer in STV editing of menus, but you can see it's hard to allow for complete editing of menus, since the menus do so much. Advanced Menu Features Conditionally show a menu ONLY for a given client Code:
<menu name="..." visible="${GetUIContextName()=="00e04c77e4ee"}"> ... </menu> The visible attribute on any menu or menuItem can accept an expression as along as it is enclosed in ${...}. Using expressions you can conditionally show/hide menus/menuItems for just about any case. You could write an expression that only make a menu visible about 9:00pm at night. Or an expression that only shows a menu item when the current user is 'bill', etc. Expressions, while requiring some programming knowledge, are a very cool way to make your menus even more dynamic. And if you master expressions here, then the vfs uses the exact same syntax and expressions. Some more common expressions that you might use... Conditional based on a property Code:
visible="${phoenix_config_GetProperty("SOME_PROPERTY_FROM_SAGE_PROPERTIES")}" Code:
visible="prop:client:SOME_PROPERTY_FROM_SAGE_PROPERTIES"
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient Last edited by stuckless; 07-04-2011 at 06:50 AM. |
#2
|
||||
|
||||
From any of the landing zones you can hit Home twice and it will reload the menus (and VFS as well).
btl.
__________________
PHOENIX 3 is here! Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient |
#3
|
||||
|
||||
Cool... I did not know that
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#4
|
||||
|
||||
Menu Fragments
Rather than copying a complete menu xml file and then just editing it to add a new item, you can use the new menu fragment tag to simply insert your custom menu/menuItem into any of our system menus. For this to work, you'll need to open our menu xml file (ie, LandingMenu.xml) and know the menu to which you want to add, and the menu item that you want to insert next to.
For example, if you wanted to add your own menu item before the "All Movies" item in the "Videos" section of the Landing Zone, your fragment might look like this. Code:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE menus SYSTEM "menus.dtd"> <menus> <fragment parentMenu="phoenix.menu.lz.videos" insertBefore="phoenix.menu.lz.videos.alltitlesdefaultbrowser"> <menuItem name="beachbody" label="Beach Body Insanity" visible="${GetUIContextName()=="00085c53c6a9"}"> <description>Beach Body Insanity</description> <eval>AddGlobalContext("DefaultView","sls_beachbody")</eval> <screen name="Phoenix Universal Media Browser" /> </menuItem> </fragment> </menus>
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#5
|
|||
|
|||
Quote:
Hi Stuckless, Would you mind posting an example of a menu item the includes an executable. I would like to be able to call a batch file from the UI. Thanks, Lynn Nevermind! I figured it out now. Lynn
__________________
Server: Sage 7.1.9, service only, Java 1.6, Win XP Pro sp2, Asus M2A-VM, Athlon 64X2 4000+, 2 GB RAM, 2 x HDHR, 2 x WD 320 GB for media, OS on OCZ Vertex 60GB Client: Sage 7.1.9, Java 1.6.0_15, Win XP Pro sp3, Asus A8N5X, Athlon 64 3500+, 1 GB RAM, Asus Silent nVidia 8400GS, WD 250 GB SATA for OS and local storage, Sanyo PLV-Z4 1280x720 LCD Sage HD300 with Sony KDL40XBR9 and Sony HTCT100 Soundbar Last edited by ellweber; 06-21-2011 at 01:36 PM. |
#6
|
||||
|
||||
@Lynn - This would be an example...
Code:
<menuItem name="lynn.command.firefox" label="Run Firefox"> <exec cmd="C:\Program Files\Mozilla Firefox\firefox.exe" /> </menuItem> EDIT: Sorry I took too long...I'm at work
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#7
|
|||
|
|||
Thanks for the pronto response, Stuckless. I was stuck in a syntax hole but I climbed out just about when you responded. I have Sage working better than ever, thanks for all of your efforts. I hope it lasts!
I am a bit confused about when the Phoenix UI reloads the menu from the User directory, I have tried stimulating it from BMT and just waiting but a restart of Sage Client seems to be the most consistent way. Lynn
__________________
Server: Sage 7.1.9, service only, Java 1.6, Win XP Pro sp2, Asus M2A-VM, Athlon 64X2 4000+, 2 GB RAM, 2 x HDHR, 2 x WD 320 GB for media, OS on OCZ Vertex 60GB Client: Sage 7.1.9, Java 1.6.0_15, Win XP Pro sp3, Asus A8N5X, Athlon 64 3500+, 1 GB RAM, Asus Silent nVidia 8400GS, WD 250 GB SATA for OS and local storage, Sanyo PLV-Z4 1280x720 LCD Sage HD300 with Sony KDL40XBR9 and Sony HTCT100 Soundbar |
#8
|
||||
|
||||
Quote:
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#9
|
||||
|
||||
Actually home twice doesn't work any more. But there is a menu option in the Global Options Menu: "Options & Configuration -> Reload Menus, Views, Config" that will reload them.
btl.
__________________
PHOENIX 3 is here! Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient |
#10
|
|||
|
|||
I thought I had tried that Bialio but perhaps it was while I was still tangled up in my syntax problems! Again, thaks for the support...
__________________
Server: Sage 7.1.9, service only, Java 1.6, Win XP Pro sp2, Asus M2A-VM, Athlon 64X2 4000+, 2 GB RAM, 2 x HDHR, 2 x WD 320 GB for media, OS on OCZ Vertex 60GB Client: Sage 7.1.9, Java 1.6.0_15, Win XP Pro sp3, Asus A8N5X, Athlon 64 3500+, 1 GB RAM, Asus Silent nVidia 8400GS, WD 250 GB SATA for OS and local storage, Sanyo PLV-Z4 1280x720 LCD Sage HD300 with Sony KDL40XBR9 and Sony HTCT100 Soundbar |
#11
|
|||
|
|||
Is it possible to use menu fragments to override the view of an out of the box (OOTB) menu or hide an OOTB menu? This would be might helpful!
__________________
Server: AMD Phenom II X6 3.20 GHz ♠ 16 GB RAM (15.7 usable) Capture: HDHomeRun PRIME ♠ Ceton InfiniTV 4 PCIe (Clear-QAM only) Tuning: OpenDCT v0.5.20-RC2 Software: Windows 7 Ultimate 64-bit ♠ SageTV v9.0.12.504 ♠ Java 1.8.0_111 Clients: 4 x STX-HD300 ♠ 3 x STX-HD200 ♠ MacOS Placeshifter |
#12
|
||||
|
||||
U can hide menus from the default ui by going to the options screen. U can also add fragments for sub menus and "override" the default menu. U can pretty much customize ever aspect of the landing zone.
|
#13
|
||||
|
||||
Post an example or idea of what u want to do and we can walk you through how to do it.
|
#14
|
||||
|
||||
Quote:
In the latter case, you can simply hide the menu using the menu editor that is built into phoenix (just hit Options, then select Options, and then Confgure Landing Zone). In the first case, just create a new menu fragment and give the menu "name" the same as the menu that you want to override. When you do this, you are basically creating a new menu/menuItem that replaces the standard one. Peronally what I'd do is create a new menu fragment and inject it into an existing menu, and then use the menu editor to show/hide the new/old menu item. That way you can still have access to the old menu item. If the menu that you want to configure is not in the landing zone, then you can use the menu fragements to hide a menuItem as well. Simply create a menu fragment and define a menu/menuItem with same name as the menu that you want to override and use visible="false", which will hide the menu/menuItem. Hope this makes sense.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#15
|
|||
|
|||
Quote:
__________________
Server: AMD Phenom II X6 3.20 GHz ♠ 16 GB RAM (15.7 usable) Capture: HDHomeRun PRIME ♠ Ceton InfiniTV 4 PCIe (Clear-QAM only) Tuning: OpenDCT v0.5.20-RC2 Software: Windows 7 Ultimate 64-bit ♠ SageTV v9.0.12.504 ♠ Java 1.8.0_111 Clients: 4 x STX-HD300 ♠ 3 x STX-HD200 ♠ MacOS Placeshifter |
#16
|
||||
|
||||
I used this code to Launch PowerDVD on my main client, but how do I add the native Sage command for PowerOff (so it will minimize Sage while I am using PowerDVD). I already have PowerDVD setup so that when I exit, it will PowerOn Sage.
__________________
Server: i3-7100, 16GB Ram, AVerTVHD Duet(OTA), HDHR Prime, 2x2TB(recordings), 128GB m.2 SSD(os), 500GB SSD(data), 1x2TB (Movies), Win10Pro 64bit Client 1: STP-HD300, Onkyo Tx-Sr707 Client 2-4: STX-HD100 Network: Linksys Router/Wifi, Netgear GS116 Switch, Cat5e/6, Intel NICs |
#17
|
||||
|
||||
Quote:
Code:
<sageCommand name="Power Off" />
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full." - Nikolaus (4yrs old) |
#18
|
||||
|
||||
As Mike said
So the complete entry should look like this... Code:
<menuItem name="lynn.command.firefox" label="Run Firefox"> <exec cmd="C:\Program Files\Mozilla Firefox\firefox.exe" /> <sageCommand name="Power Off" /> </menuItem>
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#19
|
||||
|
||||
Awesome, thanks guys!
__________________
Server: i3-7100, 16GB Ram, AVerTVHD Duet(OTA), HDHR Prime, 2x2TB(recordings), 128GB m.2 SSD(os), 500GB SSD(data), 1x2TB (Movies), Win10Pro 64bit Client 1: STP-HD300, Onkyo Tx-Sr707 Client 2-4: STX-HD100 Network: Linksys Router/Wifi, Netgear GS116 Switch, Cat5e/6, Intel NICs |
#20
|
|||
|
|||
I'm trying to pass a parameter to a batch file but it's not working.
<exec cmd="C:\Program Files (x86)\SageTV\SageTV\userdata\Phoenix\RipConvert.bat" /> works fine but <exec cmd="C:\Program Files (x86)\SageTV\SageTV\userdata\Phoenix\RipConvert.bat NicholasVideos" /> never triggers the script. Any ideas?
__________________
Alpine Website Design |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Some newbie questions: Customizing menus, media browser etc. | stounedi | SageTV Software | 3 | 05-11-2010 12:17 AM |
Customization request: Dynamic menus without dynamic menus ;-) | owilsky | SageTV Customizations | 16 | 07-07-2009 03:33 PM |
Quick questions about custom menus | pjpjpjpj | SageTV Customizations | 5 | 05-29-2008 03:02 PM |
Cached Menus | bialio | SageTV Studio | 1 | 01-18-2008 02:47 PM |