Kodi Community Forum

Full Version: ListItem.FileNameAndPath for a button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok i'm trying to use this in a fixedlist and wondering what i i'm doing wrong! trying to pull content from a addon but need some help!

Code:
<onclick>ActivateWindow(videofiles,$INFO[ListItem.FileNameAndPath],return)</onclick>
Also is there a way to put a clickable button in a fixed list with above code
Nope. You have to use a fake hidden button outside the list to control the list (or use a list with static content)

e.g. assuming it is a vertical list with the id 50.
Code:
<control type="button" id="9001">
  <visible allowhiddenfocus="true">false</visible>
  <onup>Control.Move(50,-1)</onup>
  <ondown>Control.Move(50,1)</ondown>
  <onclick>ActivateWindow(videofiles,$INFO[Container(50).ListItem.Path],return)</onclick>
</control>

Then you need to send focus to the button rather than the list.

Also if you are trying to open the file's location, use listitem.path not filenameandpath. If you are trying to play the file, use
PlayMedia($INFO[Container(50).ListItem.FileNameAndPath])
If i wanted to pull content from an addon and use a list with static content how would i be able to do this as i would like it in the list.

Code:
<control type="fixedlist" id="702">
                <description>Featured</description>
                <left>-125</left>
                <top>400</top>
                <width>4000</width>
                <height>4000</height>
                <onup>700</onup>
                <ondown>5555</ondown>
                <visible>true</visible>
                <pagecontrol>-</pagecontrol>
                <scrolltime>300</scrolltime>
                <focusposition>1</focusposition>
                <movement>1</movement>
                <orientation>horizontal</orientation>
                <content>plugin://plugin.video.testaddonl/?sort=featured&section=movie&mode=GetFilteredResults</content>
                <itemlayout height="320" width="320">
                    <control type="image">
                        <left>150</left>
                        <top>0</top>
                        <width>300</width>
                        <height>200</height>
                        <texture>$INFO[ListItem.Art(fanart)]</texture>
                    </control>
                </itemlayout>
                <focusedlayout height="320" width="320">
                    <control type="image">
                        <left>150</left>
                        <top>0</top>
                        <width>300</width>
                        <height>200</height>
                        <texture>$INFO[ListItem.Art(fanart)]</texture>
                    </control>
                    <control type="image">
                        <left>140</left>
                        <top>-10</top>
                        <width>320</width>
                        <height>220</height>
                        <texture>white_border.png</texture>
                    </control>
                    <control type="label">
                        <left>165</left>
                        <top>195</top>
                        <width>275</width>
                        <height>30</height>
                        <font>font10_title</font>
                        <textcolor>white</textcolor>
                        <visible>true</visible>
                        <shadowcolor>FF000000</shadowcolor>
                        <align>center</align>
                        <aligny>center</aligny>
                        <label>$INFO[ListItem.Label]</label>
                    </control>
                </focusedlayout>
            </control>
i know you can do this but how do i get it to pull from and addon like i have above

Code:
<content>
  <item id="1">
    <label>My First Item</label>
    <label2>Label 2</label2>
    <icon>icon1.png</icon>
    <thumb>thumb1.png</thumb>
    <onclick>ActivateWindow(Home)</onclick>
    <visible>true</visible>
    <property name="foo">Some1stValueHere</property>
    <property name="foo2">Some2ndValueHere</property>
  </item>
  <item id="2">
    <label>My Second Item</label>
    <label2>Label 2</label2>
    <icon>icon2.png</icon>
    <thumb>thumb2.png</thumb>
    <onclick>ActivateWindow(MyMusicLibrary)</onclick>
    <property name="foo">Some1stValueHere</property>
    <property name="foo2">Some2ndValueHere</property>
  </item>
</content>
You'll need to know what info the addon supplies.

EDIT: Do you realise 1channel is a pirate addon and this thread will most likely be removed?
sorry didn't realize that it was a issue! I removed the info regarding the addon
Unless the addon specifically provides window properties for static content then you will have to use a fake button as the control.