Code for Default Content Type

Hello,
I'm trying to create buttons for each content type (Music, Images, ...). I want the button to cycle between given type and . Problem is I don't know how to force this for default content format. Code looks like this:

@if:Set CONTENTFORMAT=Off
Set CONTENTFORMAT Music
@if:else
Set CONTENTFORMAT Off

Instead of "Off" I tried "General, Default, , none, Files, All files" and nothing seems to work. What is the right attribute? I searched through help files and haven't fond the answer.

It depends what you mean by "default" here.

If you want the same format you'd get if you loaded the folder normally:

Set FORMAT=!folder
1 Like

Yes, thank you, it does what I want. Though the cycling doesn't work:

@if:Set CONTENTFORMAT=Music
Set FORMAT=!folder
@if:else
Set CONTENTFORMAT Music

Is the first line here ok? I want the button to detect if the currently selected content type is Music, and if yes – switch to Default format. If not, set the Music content type.

I don't think folder formats are a state. e.g. If you touched the column widths or sort order, you'd no longer technically be using the same format, so the current format isn't tracked like that.

You'd need to test some aspect of the format if you wanted a toggle button. For example, whether one of the music columns was turned on.

1 Like

Thank you for explaining. You are right, I can check if mp3bitrate column is added. Managed to do that and it works now, thanks a lot! Here is how my final code looks, if someone is interested:

@toggle:if Set COLUMNSTOGGLE=mp3bitrate

@if:Set COLUMNSTOGGLE=mp3bitrate
Set FORMAT=!folder
Set FLATVIEW=Off

@if:else
Set CONTENTFORMAT Music
Set FLATVIEW=Off