Kodi Community Forum

Full Version: script.skinshortcuts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2016-12-07, 18:20)emre.ay Wrote: [ -> ]Is it possible to have at mainmenu.DATA.xml two thumbs for one default shortcut with properties?

No, you can only define a single icon and thumb image. If you want to add another property with an image value then look at Skin Shortcuts Docs: Custom Shortcut Properties - at the very least you'll want to Set Defaults, and there's also details there of assigning a button id to choose an image for your custom property within the management dialog.
(2016-12-07, 18:57)BobCratchett Wrote: [ -> ]
(2016-12-07, 18:20)emre.ay Wrote: [ -> ]Is it possible to have at mainmenu.DATA.xml two thumbs for one default shortcut with properties?

No, you can only define a single icon and thumb image. If you want to add another property with an image value then look at Skin Shortcuts Docs: Custom Shortcut Properties - at the very least you'll want to Set Defaults, and there's also details there of assigning a button id to choose an image for your custom property within the management dialog.
I want a weather shortcut with a weather icon thumb and background thumb (therefore I asked for two thumbs). I don't know if there a way to get this with that what you mean.
(2016-12-07, 19:26)emre.ay Wrote: [ -> ]I want a weather shortcut with a weather icon thumb and background thumb (therefore I asked for two thumbs). I don't know if there a way to get this with that what you mean.

You can certainly do it with a custom shortcut property. It may also be possible to do what you want with Skin Shortcuts Docs: Managing backgrounds. Its up to you which method is most appropriate for your skin.
(2016-12-07, 19:34)BobCratchett Wrote: [ -> ]
(2016-12-07, 19:26)emre.ay Wrote: [ -> ]I want a weather shortcut with a weather icon thumb and background thumb (therefore I asked for two thumbs). I don't know if there a way to get this with that what you mean.

You can certainly do it with a custom shortcut property. It may also be possible to do what you want with Skin Shortcuts Docs: Managing backgrounds. Its up to you which method is most appropriate for your skin.
Sorry mate but I'm a litte bit confused with properties.
Whilst I'm happy to try to assist, the docs represent my best explanation on how they work. So, if you're struggling, you need to say where you're struggling with them.

If there is a particular element of the docs that doesn't make sense to you then please make it clear what that is. If you have development code that isn't working, then please make sure to post it. It may also be worth seeing if there is another skin that implements a similar idea to yours, and seeing how they implement it.
(2016-12-07, 21:57)BobCratchett Wrote: [ -> ]Whilst I'm happy to try to assist, the docs represent my best explanation on how they work. So, if you're struggling, you need to say where you're struggling with them.

If there is a particular element of the docs that doesn't make sense to you then please make it clear what that is. If you have development code that isn't working, then please make sure to post it. It may also be worth seeing if there is another skin that implements a similar idea to yours, and seeing how they implement it.
Thanks for your help.
I develop a skin and I want to add skin.shortcuts.
Until know it create the default home menu items successful except the weather item.

What I need is the dynamic weather icon and home widgets. I already read the docs but I failed to understand how to add widgets and how I said, I'm confused with the properties (what can I do with them?).
OK, let's try breaking it down a bit.

Firstly, are you aware of the Skin Shortcuts Docs: overrides.xml file? This file is where you define a lot of the behaviour of Skin Shortcuts - from how your management dialog works (additional controls, for example, or which shortcuts or widgets are available when clicking the associated controls), and provide defaults for your shortcuts that aren't defined in the .DATA.xml file - here's an example overrides.xml file which, amongst other things, sets default widgets for various menu items and sets the gui control's 601, 602 and 603 to let the user select an additional property.

In terms of Skin Shortcuts Docs: Managing widgets, there are various elements to getting these working. Firstly, you add a button with gui 312 to your management dialog - your users can now select a widget and the properties will be available in the built menu. Then you can set defaults (note that once the menu has been edited these won't be automatically applied - it's worth resetting the menu to default to see what effect your changes are having). After that you could choose to make additional widgets available. The final stage is actually displaying the widgets which is either done via Skin Shortcuts Docs: Templates, or a pure skin-side solution. You still need to say where you are struggling with this.

In terms of Skin Shortcuts Docs: Custom shortcut properties. If all you want to do is have a default shortcut have an additional property, then you can set a default for the menu item with that ID. You could additionally define a gui id to set the value within your overrides and then include a button with that id in your management dialog. Finally you then display the background based on that property, which is a pure skin-side element. Again, you still need to say where you are struggling with this.
(2016-12-07, 22:22)BobCratchett Wrote: [ -> ]OK, let's try breaking it down a bit.

Firstly, are you aware of the Skin Shortcuts Docs: overrides.xml file? This file is where you define a lot of the behaviour of Skin Shortcuts - from how your management dialog works (additional controls, for example, or which shortcuts or widgets are available when clicking the associated controls), and provide defaults for your shortcuts that aren't defined in the .DATA.xml file - here's an example overrides.xml file which, amongst other things, sets default widgets for various menu items and sets the gui control's 601, 602 and 603 to let the user select an additional property.

In terms of Skin Shortcuts Docs: Managing widgets, there are various elements to getting these working. Firstly, you add a button with gui 312 to your management dialog - your users can now select a widget and the properties will be available in the built menu. Then you can set defaults (note that once the menu has been edited these won't be automatically applied - it's worth resetting the menu to default to see what effect your changes are having). After that you could choose to make additional widgets available. The final stage is actually displaying the widgets which is either done via Skin Shortcuts Docs: Templates, or a pure skin-side solution. You still need to say where you are struggling with this.

In terms of Skin Shortcuts Docs: Custom shortcut properties. If all you want to do is have a default shortcut have an additional property, then you can set a default for the menu item with that ID. You could additionally define a gui id to set the value within your overrides and then include a button with that id in your management dialog. Finally you then display the background based on that property, which is a pure skin-side element. Again, you still need to say where you are struggling with this.
That's a lot of informations. I will send some Screenshots tomorrow of that things what I want to have Smile
(2016-12-07, 22:33)emre.ay Wrote: [ -> ]That's a lot of informations. I will send some Screenshots tomorrow of that things what I want to have Smile

Please don't. I don't know your skin and so can't say what's the best way for you to implement your ideas for your skin. Instead, please read the docs and try your best to follow them. Then, when you struggle, say exactly where you're struggling. Implementing these things takes multiple steps and, without knowing at what point your failing (and what attempt you have made that is failing), I won't be able to provide any more assistance.
(2016-12-07, 22:35)BobCratchett Wrote: [ -> ]
(2016-12-07, 22:33)emre.ay Wrote: [ -> ]That's a lot of informations. I will send some Screenshots tomorrow of that things what I want to have Smile

Please don't. I don't know your skin and so can't say what's the best way for you to implement your ideas for your skin. Instead, please read the docs and try your best to follow them. Then, when you struggle, say exactly where you're struggling. Implementing these things takes multiple steps and, without knowing at what point your failing (and what attempt you have made that is failing), I won't be able to provide any more assistance.

No I only want to give an example because I can't explain that what I didn't understand.

So let's try: I want to have a widget of my video libary on homescreen showing by movie thumbs. First I define widgets in override.xml right? Then I must add a button in managing dialog. How can I display that widget now on my homescreen? This is where I struggle

Please a short step by step introduction.
Finally, saying where you're actually struggling Smile

Displaying the widget is a skin-side issue. Skin Shortcuts adds properties to the menu item which you can then use to determine when to display the widget. See the Skin Shortcuts Docs: Managing widgets for details of all the properties that the script adds.

So, if you've added a custom widget which has the widgetName 'myCustomWidget', you'd then use something of the order of 'String.IsEqual(Container([id-of-your-main-menu-list].ListItem.Property(widgetName),myCustomWidget)' to decide when to show it. If the widget just provides something for the <content/> element of a list - as all of the default widgets provided by gui 312 do - then you could have a single list with <content target="$INFO[Container([id-of-your-main-menu-list]).ListItem.Property(widgetTarget)]">$INFO[Container(id-of-your-main-menu-list).ListItem.Property(widgetPath)]</content>. (Or you could use templates, but that's an advanced - and confusing to Kodi skinning veterans - topic which may not be worth looking into until you've got a grip on the more basic functions of the script.)
I create a widget in override.xml called "myCustomWodget". This widget is now available in managing dialog right?

I must create now a control on homescreen like an panel and the content should be my selected widget.
Or did I misunderstood it? [SMILING FACE WITH OPEN MOUTH AND COLD SWEAT]
If you've added a new widget in the overrides.xml file via a <widget /> property then yes, this will now be selectable via gui 312 - You have actually tested this, right?

Now its up to you to do something with it. Note that all Skin Shortcuts does is let the user select it and add the properties you've selected to the relevant menu item. If you want it to link to a panel then yes, add a panel and set its visibility conditions based on the properties you've defined for that widget in the <widget /> property.

(The best way to learn to do this is to try to do it and - if you struggle - say where in your attempts to do it it doesn't work Wink)
(2016-12-07, 23:06)BobCratchett Wrote: [ -> ]If you've added a new widget in the overrides.xml file via a <widget /> property then yes, this will now be selectable via gui 312 - You have actually tested this, right?

Now its up to you to do something with it. Note that all Skin Shortcuts does is let the user select it and add the properties you've selected to the relevant menu item. If you want it to link to a panel then yes, add a panel and set its visibility conditions based on the properties you've defined for that widget in the <widget /> property.

(The best way to learn to do this is to try to do it and - if you struggle - say where in your attempts to do it it doesn't work Wink)
Can you give an example of an content? What should I write there to connect it with my selected widget?
Take a look at Static List Content (wiki) for how to define a static content for a panel.

Your final panels may look - very broadly - similar to the following. The first is for your custom widget with its static content. The second is for the various widgets Skin Shortcuts automatically allows the user to select with their dynamic content. However, the specific implementation - along with which properties you choose to check against (for example, you may wish to use widgetType to provide different layouts for music, movies, tvshows etc) is entirely a skinning issue.

It's worth checking the script-skinshortcuts-includes.xml file so you can see exactly what properties (and what values) are assigned to menu items.

Code:
<control type="panel">
    <!-- Show when it's the custom widget you've added -->
    <visible>String.IsEqual(Container([id-of-main-menu]).ListItem.Property([property-you're-checking-against]),[value-you're-checking-against])</visible>
    <!-- position, size, onup, etc -->
    <itemlayout />
    <focusedlayout />
    <content>
        <item />
        <item />
        ...
    </content>
</control>
<control type="panel">
    <!-- Show when it's not the custom widget you've added -->
    <visible>!String.IsEqual(Container([id-of-main-menu]).ListItem.Property([property-you're-checking-against]),[value-you're-checking-against])</visible>
    <!-- position, size, onup, etc -->
    <itemlayout />
    <focusedlayout />
    <content target="$INFO[Container([id-of-main-menu]).ListItem.Property(widgetTarget)]">$INFO[Container([id-of-main-menu]).ListItem.Property(widgetPath)]</content>
</control>