By default the view-definitions.xml contains 3 major sections that MUST exist "music,picture,video"
By default the view-definitions.xml contains predfined containers base off of "fixed id strings" ex: video/folders
If for some reason you dont have all of the above conidtions met, bets are that a navtree wont be displayed

However, Twonky has given us a feature to create custom views, which are nice, but...
These custom views are only links to predefined id's from the view-definitions.xml
So in order to really tweak the navtree, one has to edit the view-definitions.xml to include additional id's
These additional id's MUST be denoted with the groupid , NOT id. for ex: groupid='myvideo'

The mechanics of the navtree post 5.0.68 changed and since then its taken me this long to figure out
how to do things we used to be able to back then, yeah I know!

One of the biggest questions I see asked here in the forums is how to create a folder only view, not the 'By Folder' view,
but rather have all the folders displayed at the root of video or the root of the navtree

Well Im going to you show you how to do both of those seemingly impossible taks with the current 6.x version
Note: In theory this should work for 5.1.x versions also, as I havent tested that far back version wise

I initially wrote a bigger post here, I edited it, trying to keep it simple by the use the scenario posts
But before you go and use them, there are a few things you should know

What makes everyone one of the scenario examples work is I had to edit this line in the view-definitions.xml

In the following scenarios, they show examples of how to display folders on nodes

Scenario 1 show folders at the root of the video containerScenario 2 show folders at the root of the photo containerScenario 3 show folders at the root of the music containerScenario 4 show folders at the root of each section

In the following sceanrios, they show examples of how to display folders on the root

Scenario 5 show only video folders at the root of the navtreeScenario 6 show only picture folders at the root of the navtreeScenario 7 show only music folders at the root of the navtreeScenario 8 show all folders at the root of the navtreeScenario 9 show all folders at the root of the navtree for all media types

In the following scenarios, they show you how to display custom nodes on the root

Scenario 10 show the default video containers at the rootScenario 11 show the default music containers at the rootScenario 12 show the default picture containers at the rootScenario 13 show all the default sub-containers at the rootScenario 14 This one is the inverse of Scenario 13

You can either use them as is, or you try and change some things, and the changes might not work
I made some very specific changes in them to make them work, and some are mandatory
For ex: In some places I used name='' and in some places I used name='Vidoes ' or used no name=
These were done on purpose, so you were warned
But the good news is there are a lot of things you can change or add, just what I did as reference

I hope these examples help the people out there, you know who you are, finally be able to make some real changes to the navtree

You want to show all folders at the root of the navtree for all media types

Note:
This is useful if connecting from a PS3 for example
When browseing from the XMB it could and would see anything that branch was able to see
meaning if I went into the xmb video menu and I selected the twonky server
you would see all folders at the root, which would also include, photo and video folders at the root
so if you had a video in a share that was actually a photo share
it would show up the xmb menu when one was in video, even though the file was in a photo folder

Either edit the ini like below or change it from the gui to "All Content Types" for each share
+A means All file types
+M means music file types
+P means photo file types
+V means video file types

# CSV list of all shares, prepended by the type (A,M,P,V) and a '+' or '-' sign to flag enabled or disabled shares
contentdir=+A|C:\Documents and Settings\ADMIN\My Documents\My Music,+A|C:\Documents and Settings\ADMIN\My Documents\My Pictures,+A|C:\Documents and Settings\ADMIN\My Documents\My Videos

You want to show the default video containers at the root of the navtree

Note:
Normally there would be 3 root containers, and each root container had its sub-containers
like by folder, by genre, etc
The below changes replaces the 3 root containers
with the default sub-containers of video so that they are now at the root of the navtree

this is for people who are only using twonky for video, and dont care about anything else
when using a ps3 or other, the video tree from the device goes to video containers for real =)

You dont have to use all of the <links> in below, I just added them all to show you

You want to show the default music containers at the root of the navtree

Note:
Normally there would be 3 root containers, and each root container had its sub-containers
like by folder, by geren, etc
The below changes replaces the 3 root containers
with the default sub-containers of video so that they are now at the root of the navtree

this is for people who are only using twonky for music, and dont care about anything else
when using a ps3 or other, the music tree from the device goes to music containers for real =)

You dont have to use all of the <links> in below, I just added them all to show you

You want to show the default picture containers at the root of the navtree

Note:
Normally there would be 3 root containers, and each root container had its sub-containers
like by folder, by geren, etc
The below changes replaces the 3 root containers
with the default sub-containers of video so that they are now at the root of the navtree

this is for people who are only using twonky for music, and dont care about anything else
when using a ps3 or other, the photo tree from the device goes to photo containers for real =)

You dont have to use all of the <links> in below, I just added them all to show you

You want to show all the default sub-containers at the root of the navtree

Note:
Normally there would be 3 root containers, and each root container had its sub-containers
like by folder, by geren, etc
The below changes replaces the 3 root containers
with the default sub-containers of all 3 root containers so that they are now at the root of the navtree

You dont have to use all of the <links> in below, I just added them all to show you

This one is the one that I currently use, on an HP MediaSmart Server wunning Windows Home Server

What is different about this one is that in the video section
I have each group with sub sections like one would expect
what is different is that I do it twice
one to add the actuall file names
and then again to add the sub containers
if it isnt done like this than only the last container would show filnames

In the By Title section, it allows me to drill down by letter
So say I pick "A" I would get all the video starting with "A",
and I could then drill down again to view all videos either by genre or year, that start with "A"

UPDATE: This is not working as I had hoped, as buildon logic isnt right when building its tree

If you wanted to show recently added files and know where they were
You could do something like shown in the following examples
They will create lists based on items recently added by Album, Folder, Genre and Year

In this example, the buildon is in a named container 'ByFolder'
which is in a named container 'vidoes'
<view>
<navtree>
<container name='videos' >
<container name='Byfolder' createClass='object.item.videoItem.movie' class='object.container' >
<container buildon='res' createClass='object.item.videoItem.movie' class='object.container'/>
</container>
</container>
</view>
</navtree>
The output of the above is returned like this
which is correct
Vidoes -> ByFolder -> FolderA
FolderB
FolderC
Filename1

In this example, the buildon is in a named container 'ByFolder'
<view>
<navtree>
<container name='Byfolder' createClass='object.item.videoItem.movie' class='object.container' >
<container buildon='res' createClass='object.item.videoItem.movie' class='object.container'/>
</container>
</view>
</navtree>
The output of the above is returned like this
which is correct
ByFolder -> FolderA
FolderB
FolderC
Filename1

In this example, the buildon is in an unamed container
the name of the container or containers to be created
would be based on the buildon='res'
wich is also true for the previous examples
but this time it is not nested in any named container
<view>
<navtree>
<container buildon='res' createClass='object.item.videoItem.movie' class='object.container'/>
</view>
</navtree>
The output of the above is returned like this
which is incorrect
FolberB -> SubFolder -> Filename4
Filename3
It did not return the Filename1 from the root of the share
It did not return any folders that did not have a subfolder

<view>
<navtree>
In this example, the buildon is in an unamed container
But to try and force an additional nested list
I added a second buildon container to buildon from the first
<container buildon='res createClass='object.item.videoItem.movie' class='object.container' >
<container buildon='res' createClass='object.item.videoItem.movie' class='object.container'/>
</container>
</view>
</navtree>
The output of the above is returned like this
which is almost correct, it does not return any files at the root of the share
It also due to the double buildon is adding a nested loop of the parent
into the child with the name of the parent
FolderA -> FolderA -> Filename2
Filename2
FolderB -> FolderB -> Filename3
SubFolder
Filename3
FolderB
-> SubFolder -> SubFolder -> Filename4
Filename3 Filename4
FolderC -> FolderC -> Filename5
Filename5

In this example, which is just like the above
I added a name to the secoind buildon to try and hide the nested parent child problem
<view>
<navtree>
<container buildon='res createClass='object.item.videoItem.movie' class='object.container' >
<container name='' buildon='res' createClass='object.item.videoItem.movie' class='object.container'/>
</container>
</view>
</navtree>
The output of the above is returned like this
It does mask the parent child nesting, with a blank named container
but it does not stop it from being populated
and we still dont have files from the root of the share
FolderA -> <blank> -> Filename2
Filename2
FolderB -> <blank> -> Filename3
SubFolder
Filename3
FolderB <blank>
-> SubFolder -> <blank> -> Filename4
Filename3 Filename4
FolderC -> <blank> -> Filename5
Filename5

In this example, like the previous two
I made one more change that should not have worked the way it did, but...
I removed the last ' from the second build where class='object.container
<view>
<navtree>
<container buildon='res createClass='object.item.videoItem.movie' class='object.container'>
<container name='' buildon='res' createClass='object.item.videoItem.movie' class='object.container />
</container>
</view>
</navtree>
The output of the above is returned like this
It also masked the parent child container name with the name base
of which I can not rename in anyway
but the good news is that it is an empty container
and there will only ever be one per child
but alas, we still do not show files from the root of the share
FolderA -> base
Filename2
FolderB -> base
SubFolder
Filename3
FolderB base
-> SubFolder -> base
Filename3 Filename4
FolderC -> base
Filename5

So there you have it, that is what I have learned

If you want to have folders at the root of the navtree, you will not be able to see files at the root of the share, all else appears

Hopefully in the future we can get Twony to make code changes to the buildon='res' command to return items in unamed containers
without having to do what I did to get it to sort of work

Last edited by phibertron on Wed Mar 02, 2011 3:11 am, edited 2 times in total.

Note:
This is only for the same level of parent/child navigation
If the name= of child container is the same name of a parent
then it has not effect on any other parents named with the same name

In the code that builds the navtree to stream to clients
It uses the name= and the id= to make everything go where it is supposed to
We can take adnvantage of this, and have different id= and groupid= with the same name
to create one container that contains both sets of data

The following would create one container called "By Example" with the result from both id's

Note:
The reverse is not exactly true, two with id= or two with groupid=
as they tend to overide each other, or they null out, or break navtree all together

There is another way we can take advantage of using named containers with the same name

In this example, the container for buildon='dc:title[1]'
only contains sub containers for buildon='pv:extension'
and those sub sub containers contain the actual items to be returned
But I want the buildon='dc:title[1]' to return items and containers

In this example, I am leverageing the same behavior the equally named container exhibit
By using two parent containers using buildon='dc:title[1]'
One for just items, and one for sub containers
But because both parent containers are using buildon='dc:title[1]', they end up being the same
and thus get concatenated as one container

Note:
Why they use buildon='pv:onlineServiceTitle' for the music container, I dont know
But if you change it to buildon='pv:onlineServiceName'
It does work, but loses the name Handpicked Radio and becomes webRadio

The root container Playlists would return the following
I created the 3 wpl playlist files, with names in the file as Music Playlist,Photo Playlist,Video Playlist

Most Played
Most Viewed
Last Played
Last Viewed
Recently Added
Music Playlist
Photo Playlist
Video Playlist

Note:
What is most interesting is due to the concatenation I'm doing
The recently added for example, will contain media for all types =)
Still need to see If I can get named playlists to concatenate

The following DOES NOT WORK
I attempeted to see If I could get things at the root of navtree
It seems it exhibits some of the limitations that buildon='res' has
But worse, as it will return nothing
I tried them individually, no luck there either
I included the below just as an example of what does not work

Note:
Also don't touch the following, I know If I remove then, things go boom!
I have tried a bunch of different things with them
But I haven't figured out the logic of what is or is not possible yet
or the connection of when I do try to manipulate this flag

Great job done!! Looking long time for that - espacilly Szenario 14 - but I've still the problem of wrong MP3 sort order (not ID3 Tag but alphabetically...*grrrrrr*) I remember, iwwas somehow like "Sortcriteria" in the view-definitions.xml. Can you help?

mikle_01 wrote:Great job done!! Looking long time for that - espacilly Szenario 14 - but I've still the problem of wrong MP3 sort order (not ID3 Tag but alphabetically...*grrrrrr*) I remember, iwwas somehow like "Sortcriteria" in the view-definitions.xml. Can you help?

Thanks man

Note: I just literally updated all of the scenarios, and added zip files
all scenarios work on everything I could test them on
Still have to add some notes about folders on the root root of the navtree
The solution i have works with one exception, ill make a note of it soon

Sure, Ill try my best

What section or sections of the music node need to be sorted different for you
I do remember some people talking about that, and they changed some of the sorton stuff to fix it
All of what I did above was from default xml files, as to not make it not to complicated,
which is why you probably see the sort order regression

1. You want only folders in the root of music, photo, and video
2. You want this to also be seen the same to all devices, the xbox as an example
3. You want to add more to each section and have this also be seen the same by the xbox for example

I only need Music -> "navigate by directory" directly in the root of navtree (without "All music" and so on...)

If none of the above works I know one more trick that should work
As the problem is really with building containers with the buildon='res'
when is done from a container that has no parent name
which is why I came up with using twice like I do

Another issue I detected is the missing cover in the Twonky webbrowser - with my "good old 4.4.18" on my NAS it allways works very well (I have allways "folder.jpg" in every folder and additionally have a small cover embedded inside all mp3's via ID3 tag)

But the worst is, that the CD cover still not shownwith thumbs while browsing in my folders (navigate by folders) with my loved Philips Streamium NP2500. But while playing the mp3's the cover is shown filling...that's ok .

It only works by "navigate by Album, Interpret" and so on...

What could be this issue!? It's important for me, because I accustomed to that...

PS: I made and make first test under Windows - even this problem here - no NAS / Linix System!!

Last edited by mikle_01 on Thu Mar 03, 2011 1:45 pm, edited 1 time in total.

Sorry - but now I'am total confused (too much code ). I'll try, to understand and changed the xml you create; but there is no section starting with "container name='' buildon.... only "container buildon='res"!! What parts (lines) have to change!?

Thank's for you individual support, my "Sagem My Dual Radio" (verry similar to the Terratec Noxon modells) now runs directly to the root and all folders shown and the sort order is ok! That problem is solved.

But my other clients do the same as before - only a couple of folders appearing in the webbrowse gui and on my Philips Streamium (but now with coverart thumbs in root navigation!) , Xtreamer, Philips TV... What a deviant behavior

If I had to guess the "Sagem My Dual Radio" is seeing the results of this container
<container name='music' id='music'

It appears that for some devices twonky is hard coding what to give to certain devices
and others it relies in what the web gui shows
<container buildon='res' groupid='mymusic'

with that said I have attached test 2
in this test to get some sanity back
i have added a container to the view and to the definitions xml files
<link groupid='mymusictest' />
<container name='- By Folder Test -' groupid='mymusictest'

this should show a container at the root of navtree called "'- By Folder Test -"
it is what this returns that I am interested in

"phibertron" - you're great! It works fine and perfect!!!!! My Sagem still offers all folders (without "By Folder Test"), the others "By Folder Test" and the few folders. Try to get rid of them (rebuild of DB), but no luck. They still appears...
Hope, this last issue could be fixed. Are you Twonky staff, or is it your business?

I'am so glad! Everything now works this way I want!! The Sagem runs directly into the root and the other like the webbrowse gui (Root folder "Musik"). And the Philips runs - in spite of coverart thumbs - fast and response very quickly and flowing! This is the way, I'am realy satisfied and enthusiastic about Twonky; espacilly on my NAS!!

Since were using folders at the root of music
I made it so the container created for playlists will be the first folder in the music tree
and then the music folders would be listed below that
this way you dont have to scroll down that 150+ list of folders to get to the playlist folder

It works! I have indeed "Last play", "Recent play", "most play",... and I don't really need that (only the playlist) perhaps it's possible to fix that little issue? Again, thanks so much for the work and the files

Hello Phibertron,
wow, this is an impressive thread!
Do you know if the following would be possible:
Offer a few different options in root like "ChildrensMusic", "Classical", "Mainstream", which all point to different (sub-)directories. From there on I would like to see the normal navigation options (or just some of them), like "artist/album", "by year" and so on.
The core idea is to keep different music collections apart, while still being able to navigate within each of them in the known way...
I just love to listen to a mix of all of my latin music, but it's not quite the same when Children's music, comedy and other stuff get mixed in as well
I don't want to use genres for this, as my genre definitions are much more detailed.

Alternatively, I also wouldn't mind too much to have the first two menu levels merged into one, with entries such as "Children's: Artist/Album", "Children's: by year", "Classical: Artist/Album"... etc. I think I could manage to keep the list at a handleable size
If you think this would be possible, I'd appreciate some hints