I was trying to use the {content by label} to build tables of contents.
Basically I want to maintain a "master list" of all customers with each customer having their own page (and children). I want to then build smaller lists of customers based on what level of service they subscribe to. So I could have Company X that is labeled "customer" "LEVEL2" and "x". I want to list this customer in the master customer list and I also want to list this customer under our "Level 2 Customer List". I want the lists to dynamically be built based on current pages that match the criteria. That way we can edit the customer data, add or remove labels based on changes in their service level, and the contents lists would automagically be updated with the new page labeling.
The problem with this plan is that if I have no matching results to display (no Level 2 customers that begin with the letter "Q" for instance), I get an unattractive "No content found for label(s) q" result. I would like to conditionally suppress any blank results but I haven't found a way to accomplish that.
Any ideas? Is there a better way to build dynamic indexes with conditional blank space supression within confluence?
Hey Ken,
Please correct me if I'm wrong, but you want to suppress if the message is "No labels found" and show if there is labels. Right? This would confuse some users, if they are using it, BUT, if you want to use it for you, and know that it would be shown as you want, then I've written a custom User Macro just for you :)
## @noparams ## This sets the variable to see if it contains a word #set ($bodyContent = $body) ## Then checks if it has no labels, and it does a custom message, or could be empty :) #if ($bodyContent.contains("No content found for label(s)")) There is no Cookie for you #else $body #end
Hope this is what you wished for, if not let me know and I can try to tweak it more!
Cheers,
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.