Solved

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

Posted on 2012-04-11
5
600 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 32

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
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

627 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