Solved

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

Posted on 2012-04-11
5
597 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 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