Solved

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

Posted on 2012-04-11
5
585 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:Ingeborg Hawighorst
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SharePoint 2013 6 57
Sharepoint Max date with criteria 2 96
Disable Checkout in SharePoint 2010 3 67
DataTables - table not rendering.  No error either 5 76
Last week I faced a strange issue recently, i have deployed SharePoint 2003 servers for one project and one of the requirements was to open SharePoint site from same server. when i was trying to open site from the same server i was getting authentic…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

821 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