Solved

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

Posted on 2012-04-11
5
563 Views
Last Modified: 2012-04-12
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.
0
Comment
Question by:MegGrace
5 Comments
 
LVL 31

Expert Comment

by:Jamie McAllister MVP
ID: 37836329
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.
0
 
LVL 15

Accepted Solution

by:
dp_expert earned 500 total points
ID: 37836690
I would do it this way:

- using SPD embed the webpart zone and webpart you want to hide in a div, with display set to none
- add a list view on the page with the list containg the patameter
- edit it with SPD and add conditional formating to hide the row if parameter is equal to "No"
- add a javascript in the row to show the div
0
 
LVL 50

Expert Comment

by:teylyn
ID: 37836850
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.
0
 

Author Comment

by:MegGrace
ID: 37837978
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!
0
 

Author Closing Comment

by:MegGrace
ID: 37838104
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
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now