INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Custom rule question  (Read 2631 times)

akhunaton

  • Regular Member
  • World Citizen
  • ***
  • Posts: 136
  • I Love Music
Custom rule question
« on: April 26, 2012, 07:02:44 pm »

How do I write a custom rule to show both of these in the same place. I have created a library field called "Genre 2" because my wife wants to tag some of my music with genre "Belly Dance" but I want to keep them as "World". I am trying to make a view that shows all of the Belly Dance Genre and also includes files tagged with Belly Dance under Genre 2.  This does not work> [Genre]=Belly Dance or [Genre 2]=Belly Dance
Logged

221bBS

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 703
Re: Custom rule question
« Reply #1 on: April 26, 2012, 07:11:11 pm »

Create a new expression field and enter this:

Code: [Select]
[Genre]If(IsEmpty([Genre 2]),,;[Genre 2])&datatype=[list]

This will combine the two field into one.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Custom rule question
« Reply #2 on: April 26, 2012, 07:29:57 pm »

Alternatively, let listbuild() do the work, replacing the if().  For a single string of semicolon/space-separated items:

   listbuild(1, ;/ , [Genre], [Genre 2])

or for the items individually listed under an expression column:

   listbuild(1, ;, [Genre], [Genre 2])&datatype=[list]
Logged
The opinions I express represent my own folly.

akhunaton

  • Regular Member
  • World Citizen
  • ***
  • Posts: 136
  • I Love Music
Re: Custom rule question
« Reply #3 on: April 26, 2012, 07:43:06 pm »

I am not sure how to enter this (listbuild) in correctly into the "set rules for file display" area. thanks.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Custom rule question
« Reply #4 on: April 26, 2012, 07:51:52 pm »

Probably no need.  Where are you trying to see/use these?

  - as a category in a panes view?
  - as a column in the file list?
  - as a category in a categories view?
  - as a category in Theater View?
Logged
The opinions I express represent my own folly.

akhunaton

  • Regular Member
  • World Citizen
  • ***
  • Posts: 136
  • I Love Music
Re: Custom rule question
« Reply #5 on: April 26, 2012, 08:05:18 pm »

I am using this as a library View called Belly Dance. Which contains all files tagged Genre=Belly Dance and all files tagged Genre 2=Belly Dance

thanks for your help.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Custom rule question
« Reply #6 on: April 26, 2012, 08:08:26 pm »

Right-click the view, and select Customize view.  What is the type listed under "View As" (the pull down)?
Logged
The opinions I express represent my own folly.

akhunaton

  • Regular Member
  • World Citizen
  • ***
  • Posts: 136
  • I Love Music
Re: Custom rule question
« Reply #7 on: April 26, 2012, 08:11:08 pm »

View as Categories
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Custom rule question
« Reply #8 on: April 26, 2012, 08:20:40 pm »

Customize the view.  Remove the Genre category under "Show Categories In This Order", and Add a new category of type Expression, setting this as the value:

   listbuild(1, ;, [Genre], [Genre 2])&datatype=[list]

Name it something like "Genres", or whatever you like.  Move it to the top of the list where Genre was.

You're replacing the category being used to drill down with your combined category list.
Logged
The opinions I express represent my own folly.

akhunaton

  • Regular Member
  • World Citizen
  • ***
  • Posts: 136
  • I Love Music
Re: Custom rule question
« Reply #9 on: April 26, 2012, 08:40:51 pm »

Sweet! that worked beautifully, thanks!  :D
Logged

akhunaton

  • Regular Member
  • World Citizen
  • ***
  • Posts: 136
  • I Love Music
Re: Custom rule question
« Reply #10 on: April 26, 2012, 08:54:10 pm »

whoops. Actually no it did not work. What now is needed for it to show genre=Belly Dance or genre 2=Belly Dance?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Custom rule question
« Reply #11 on: April 26, 2012, 10:10:05 pm »

Ah, I see, you're creating a view that shows ONLY tracks with Genre or Genre 2 containing Belly Dance.

Set the rules for file display to this (you can use the Import/Export button to copy/paste)

   ([Genre]=[Belly Dance] or [Genre 2]=[Belly Dance])

Note the parens - they mean OR.  You'll see them after you click OK in the wizard.

You can remove that Genres category expression created earlier.
Logged
The opinions I express represent my own folly.

akhunaton

  • Regular Member
  • World Citizen
  • ***
  • Posts: 136
  • I Love Music
Re: Custom rule question
« Reply #12 on: April 26, 2012, 10:49:41 pm »

Perfect! many thanks.
Logged
Pages: [1]   Go Up