Link to home
Start Free TrialLog in
Avatar of MegGrace
MegGraceFlag for United States of America

asked on

Only show a SharePoint WSS 3.0 web part if the list item is set to yes

I have created a list that only will contain one list item. We will use this for activating our Emergency Management procedures, so a designated person will set this list item to "yes". Is there a way to show this web part on a page ONLY if that value is set to yes? Thanks.
Avatar of Jamie McAllister
Jamie McAllister
Flag of Switzerland image

Aside from custom code in the webpart that controls it's visibility by querying the list when rendered I see the following possibilities;

Security Trimming control (Wouldnt work with your list)

Audiences  (Wouldnt work with your list)

Javascript to set surrounding DIV of WP to be visible (how would a list change trigger it?!!)

SharePoint Designer Workflow on your custom list that changes *something* to make the webpart visible when the list item is flipped to yes.

The workflow seems the best option aside from custom code.

However, I'm assuming your webpart in on multiple pages throughout the site? Not easy to operate on.

With the above in mind, can you give me a little more information about the webpart to work with. Is it custom, or an out of the box webpart?

Is it just a content wp? If so, strikes me that content could be aggregated onto a page from a particular list item. The list item is blank, but the content is populated by your custom workflow so appears when the workflow runs. (Different way of thinking about the problem)

In the same way of thinking there's also an existing list called "resuable content" that can have it's content placed on all pages. Your workflow could potentially populate text in there that then would appear on the pages (already placed).

But I'm getting ahead of myself - please tell me what your webpart is doing.
ASKER CERTIFIED SOLUTION
Avatar of dp_expert
dp_expert
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just off the top of my head ( not in front of SharePoint right now)

- insert a list view web part
- set the chrome to none
- edit the view and set a filter to show only items with "yes" in the pertinent column.
Avatar of MegGrace

ASKER

Thanks for all the responses.

Jamie - the web part will be displayed on just one page. I created a custom list, it will only have one entry (assuming the people responsible for using it follow instructions). If we are on disaster alert, they choose the entry that indicates we are on alert. When we are no longer on disaster alert, they change it back to the appropriate entry. So on my main page, I would like that one item in that list to show ONLY when we are on disaster alert. I will test the workflow today to see if I can make that work. It sounds reasonable.

Teylyn - It shows no items found when the view is empty, but I will look at conditional formatting for that and play with it today.

dp_expert - I'll take a look at that today as well.

Thanks all!
I didn't use the javascript part, just added a data view in SPD, and set the conditional formatting to hid when we are not on active status. Thanks for all the help