Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Hide empty webpart

  Asked By: Judson    Date: Mar 18    Category: Sharepoint    Views: 2995

My IT dept wants to be able to post alerts for upgrades, weather
closings and that type of thing on the main page of various site
collections. They only want the web part to show if there is a recent
message. I was thinking that we could create an announcements list on
one of the sites and then point to it on the other sites by using the
Page Viewer web part. However, I do not know how to put a condition on
the webpart to only show when there is recent data. Does anyone know
how to do this? Or if there is a better solution for the alert request.

Share: 

 

12 Answers Found

 
Answer #1    Answered By: Iris Ballard     Answered On: Mar 18

You might consider using either a data  View (can be used anywhere via
the list web  services) or a Content Query (only in the same site
collection) web part  instead, both of which should allow you to apply
the necessary filter.

 
Answer #2    Answered By: Jamila Guthrie     Answered On: Mar 18

How do I make this data  view available to other site collections once
I have created it on the initial site collection page?

 
Answer #3    Answered By: Kalpana Ghatge     Answered On: Mar 18

Create the original DVWP using the lists web  service as your data  source
(not the site-scoped list  data source you see OOTB in SPD), then export
the web part  to a local file and upload/import into each site you need
to display it.

 
Answer #4    Answered By: Bobbie Rodgers     Answered On: Mar 18

Is there any documentation online that describes how to use
the 'lists web  services' as my data  source? I figured out how to do
the data view using the site-scoped list  but I'm not sure how to use
the web service.

 
Answer #5    Answered By: Bhumi Gokhale     Answered On: Mar 18

Using a web  service as a data  source for a Data View in SharePoint
Designer:

www.sharepointblogs.com/.../showing-web-servic
e-data-in-a-data-view-web-part.aspx

Reference for the Lists web service:
msdn2.microsoft.com/.../...lists.getlistitems.aspx

 
Answer #6    Answered By: Davon Henson     Answered On: Mar 18

The first link is no longer available.

I found some other posts on the Intranet and was able to pull up a
list of the lists but can't seem to figure out how to pull up the
data within the specific Announcements list.

The post  had me put  the following for the XML web  service connection:

Service location: http://myservername/_vti_bin/lists.asmx?WSDL
Port: ListsSoap
Operation: GetList
Parameters: listName = Announcements

I'm new to data  views and the web services connections.

 
Answer #7    Answered By: Aakash Gavade     Answered On: Mar 18

The URL on the first link got linewrapped - try pasting it into your
browser directly. To get a specific list, you need to add the listName
parameter and set its value to either the list  Display Name or its GUID
(including the curly braces). You'll also want to make sure the Service
location URL includes the appropriate site path (e.g.
http://myservername/site/subsite/_vti_bin/lists.asmx?WSDL) where the
list lives.

 
Answer #8    Answered By: Dara Hobbs     Answered On: Mar 18

Okay, I checked all of this but it still only gives me only fields
related to the properties of the announcements  but doesn't give me
the actual data  fields listed in the particular announcements list.
Where should it be located in the folder list  when I click 'Show
Data'?

 
Answer #9    Answered By: Abhinivesh Suvarna     Answered On: Mar 18

You need to change the data  command from GetList to GetListItems.
Put in the GUID of the list  as the list name, and optionally the
GUID of a view.

There is a utility available at
blogs.msdn.com/.../a-little-guid-
picker.aspx (this URL probably wrapped so you will need to copy and
paste it back into one piece) which makes it much easier to get the
GUIDs.

 
Answer #10    Answered By: Micheal Knight     Answered On: Mar 18

You can also get the GUID of the list  by using the GetList web  service.
Use GetList to get the GUID of a particular list, and then GetListItems
to get one or more Items from the list. You can also pass a CAML query
as one of the parameters of the GetListItems call to limit the list
items returned.

 
Answer #11    Answered By: Yvonne Rodriquez     Answered On: Mar 18

The GetListItems worked..thanks. When I add the Body field to my
data view it is including <div> tags instead of just displaying the
body text. Do you know how I get rid of this?

Example: <div class=ExternalClassF3621B6D4F20472F865DD5C9D28B2D1F>
<div>Austin office closed due to bad weather today and tomorrow. Will
be re-opening on Monday</div></div>

 
Answer #12    Answered By: Elisha Abbott     Answered On: Mar 18

Nevermind...just figured it out. I have to change it to Rich Text.

 
Didn't find what you were looking for? Find more on Hide empty webpart Or get search suggestion and latest updates.




Tagged: