Sharepoint 2007 - Finding out where a view is used - sharepoint

I'm a MOSS 2007 newbie and am trying to find out where a view is used.
I have a larger list and i want to have two different views into that list. I've inherited the site collection, and currently there are three views, with two of them named almost identically. Now i'd like to find out if i can safely remove one of those views.
So the question is: Is there a way to find out all references to a view?
I'll provide additional information gladly!

"First part of my problem is that i'd like to find out which view this web part is using."
"Second part is that i have a set of views made from a list, and i should find out if some web part is using some of those views"
A Web Part does not use a view directly. The current view of the web part is based upon a view, but if you change or delete the view, the web part still displays your list/library as before. Thus, if you delete your views, all web parts will still continue to function.
What you should probably do is compare your views (which fields are displayed, filtering, sorting, grouping, etc.) with each other and also with the view inside your web part. That way, you'll know which view was used before.
What could happen is that you break links to your view page. This is, if on some other page there is a direct link to your view.

What are you trying to do exactly? To get all the views of a specific list, use SPList.Views and load them in the SPViewCollection.

Related

Pulling two different sets of data from the same document library in a single page SharePoint 2013

I have a document library set up with multiple different categories of document, and I'm using a metadata column to differentiate between them.
I want to be able to display two different document library web part on a page for different categories of file side by side. This is simple for one category, I just set up a list view filtered by the metadata column, but when I add a second web part alongside the first, it breaks the first one.
I have no idea why this is happening, but it seems like SharePoint isn't happy with pulling two sets of data from the same document library.
When I am editing the web parts, I can get them to both display the documents I want, but then when I click save, the first web part empties.
Not sure what other information would be useful for diagnosing or helping with the problem, so if I haven't given enough detail let me know. I am familiar with SPD as well as developing through the web interface, so if this needs a more complex solution that's fine with me!
Having spent some more time playing around with this, it struck me that I could probably achieve what I wanted using something other than a Document web part, and I was right.
Instead of using the somewhat inflexible document web part, I created a content query web part which only searched within the document library from my site, and filtered by the metadata column.
This way I can create as many queries as I like and they don't interact with each other in weird ways. It also has the advantage of being significantly easier to customise the output without needing to resort to SharePoint Designer.
Content Queries are the answer!

SharePoint 2010 Survey View

I need to add an ability for users to add custom views for a Survey List. Using Designer is not an option.
In order to add a new View I now open the standard SharePoint form "/_layouts/ViewNew.aspx?List={SurveyListID}".
I setup a new view selecting the fields I want to see. Then, when I look at this View it looks like standard "{SurveyTitle}/overview.aspx" view no matter what I do. But I need it to look more like a SharePoint list view. I've seen dozens blog posts where people used this method and no one mentioned any problems like I am having. I've tried this method using 3 different SharePoint farms and I get the same behavior.
I was able to create a view that works OK using Designer by copying "All Responses" View and editing . However, forcing users to use Designer is not a great idea.
Does anyone know an easy method to force my custom views to display properly in Survey List?
Finally, I've found solution.
Open the page /_layouts/ViewType.aspx?List={SurveyListID}
Create a view based on "All Responses" View
Done! No need to use Designer

How to use PageLayout in a SharePoint Site?

I am kind of new to SharePoint. I am learning it on the go and learned about the concept of pagelayout and publishing features on the site. But I am not really 100% sure what is the difference between a WebPartPage, SitePage and PublishingPage. I kind of know what all these pages be used for, but what I not get is: why do they need to separate all these pages?
I think we can just get a publishing page and have all the feature there including webpart and everything else (with our choice of PageLayout). However I dont see a way to use a pagelayout on a particular SitePage.
Is there any particular reasons for using either one of them? Even though it seems like one of them can serve as all of them?
You should use page layout when ever you know the page structure. For example you are running an online news paper. You want to show the news to the users into three columns. First column is for menu, second column is for news content and third column is for advertisements. Now in your daily usage this layout is common. So you can use this page layout for entering the news. After creating the page layout you can make it as a default to your pages. Page layout is nothing but the structure of a page simply!!
A webpart page does not have a field for content directly on the page like a SitePage has. A Publishing Page is like a SitePage, but requires extra fields for dealing with the publishing extra features.
Using a single layout for all three risks being confused as to why one page does not work the same as another when it has the same layout (the difference would be the underlying features are different.).
I will make a comparison with cars. There are three type of cars, each is better suitable for a certain purpose: tractors for farming, buses for public transport, light cars for private transport. You could use a tractor for all the purposes above but it's not ideal.
"One of them can serve as all of them". This is not true in their current implementation. I'll give you one example: prefer Web part pages against Publishing pages to better control content added by contributors in an intranet. There are many other examples.

Sharepoint Branding

I'm just tasked by my boss to create a Sharepoint solution for the scenerio below.
(I'm a total newbie to Sharepoint. So please forgive me if i use the terminology wrong)
The portal should open in a custom look than the default Sharepoint design and it should have links to the products. Every product page should have different look and feel but have same types of content. For example every product should have Published Materials list but with different set of content.
So, an example of the desired map is like this:
/Home
-Latest News
-Core Team List
-Products
-Product 1
-Product 2
-Product 3
I found Sharepoint a whole new and strange world. I thought i'm good at learning, until i met Sharepoint. Everything seems very detailed and i'm living difficulties in finding useful information quickly. Because i have no Sharepoint background and i don't event know what i'm lookin' for.
Could you please help me by telling me how can i accomplish this or even just telling me the name of "thing" that i'm trying to accomplish.
Thank you in advance.
PS. Oh, by the way, I learned the word Branding in my search for the holy grail. I don't even know that the word fits or not...
I did try the method you post on other page (Restaurant review site in SharePoint) but unfortunately i couldn't succeed. I stucked at choosing what type of content type in the "Create Content Type" page at first and then tried some parent types but i couldn't get it show up in Sharepoint Designer 2007's New Sharepoint Content "Publishing Page" dialog.
So i tried something else.
At my homepage created a new Document Library of type "Web Part Page" called "Products". It created me a some sort of list whose all items are web pages. At this point i felt that i'm near to accomplish something at last.
Here are some questions i've collected: :)
I add two Announcements web part to different "Products" pages. When I add a new announcement to the list from one product page, it shows up in the other one too! How can I make their content only visible in page that the content created on?
*[Theming is a recurring theme in my posts]* Is it possible to change the view of each Product page at this setup so they have different design and color?
Thanks.
Check out the links I posted in the answer to this question for some links to SharePoint 101 tutorials online:
Restaurant review site in SharePoint
Given you're looking for 'branding' that will mean a custom Master Page. A Master Page is what will determine the overall layout of your SharePoint Web Application's pages. After creating a standard SharePoint application, connect with SharePoint Designer and play with that Master Page for a while until you get the hang of it.
In modifying or creating custom Master Pages, it is important to take note of all the controls (special ASP.NET server-side tags) in particular Content Place Holders; if you create your own Master Page and these are missing you're in a world of uninformative-error-message hurt.
You're going to want to create Lists ( http://office.microsoft.com/en-us/sharepointtechnology/HA011199881033.aspx ) to represent 'News' and 'Products'... for Products you may even want to create a Content Type.
Once you create 'News' and 'Products' lists, to see those lists of Products you'll want to make views and use List View Web Parts ( http://office.microsoft.com/en-us/help/HA100240521033.aspx ) to include those views in Pages... but at the subject of Web Parts this is probably getting a bit overwhelming so I'll stop here. Comment me if you'd like more.
Addendum
"Is is possible to show only categories of a document library in home page and documents of the selected category in another page?"
-> Yes, and there are several ways. I'd suggest you look into either defining a View for that list which filters based on the category field, then add List View Web Parts to your home page, or writing custom XSLT for the Content Query Web Part, and then add it to your home page. Writing the XSLT for he Content Query web part is a little more difficult, but using the List View has it's short comings in being not-as-configurable, much like this guy is finding out: No-code solution for calendar view of SharePoint news items
"But how can i change a list item to show its details as a whole new page with its own web parts and theme?"
-> Here's the kicker; in SharePoint, each Site you create has a special list for Pages, and each Page actually belongs to a Content Type.
So you can take any content type and turn it into a page; all you have to do is create a Page Layout for it, and add that Content Type to the list.
(So, an example. This is purely speculative; I'm not saying do this specifically, and you probably can't do it exactly as I describe it as I'm oversimplifying a little)
You create a Content Type 'Product', but you also decide 'Category' should be a Content Type too. So you create a content type for 'Catagory', and you give it a lookup column, which refers to items in the 'Product' List. You specify that the lookup can contain multiple items.
Now you want a Page where people can see a category, and all the Products which belong to it. You create a 'Page Layout' (an aspx file) for the 'Catagory' Content Type. In the Page Layout aspx file you can include web controls which render the Catagory's fields, such as 'title' and 'description' and you can probably even add one to render the 'Products' lookup field. (maybe you'll have to code it yourself)
I hope I haven't lost you.
Now that you've created a Page Layout for 'Catagory' you can add 'Catagory' to the Pages list/library and then create pages which represent Catagories, and when people edit those pages, they will also edit the Catagory.
More Addendum
If "Announcements" is a list, the web part you added was a list view web part, and so it just shows the contents of the list (which is independent of the product pages)
You'll want o specify filters of your view. I dunno if you can specify unique filters on the web part... but you can try :)
You might want to consider looking into The Content Query Web Part.
I don't fully understand your second question, but I get the feeling the answer is yes... what do you mean by "view"? You gotta be careful with the lingo; do you mean the Page Layout? or the List View Web Part? or the List View? or the Master Page? ...
you HAVE to check out Heather Solomon. She is the shiznat when it comes to sharepoint branding.
A good start would be using Sharepoint Designer.
Use SharePoint Designer to do your CSS work, particularly in discovering the CSS rules in play. DO NOT publish the finished work from SD; if you do, future Windows Updates may wipe out your files. Instead, deploy your customizations as a Feature. In MOSS 2007, you can add a single custom CSS file using Central Admin - this will then be applied AFTER core.CSS at runtime, To the best of my knowledge, this is the only practical way of doing this.
You need to indicate whether you are using WSS or MOSS. With WSS, you can use themes.

SharePoint SPContext.List in a custom application page

I have a custom SharePoint application page deployed to the _layouts folder. It's a custom "new form" for a custom content type. During my interactions with this page, I will need to add an item to my list. When the page first loads, I can use SPContext.Current.List to see the current list I'm working with. But after I fill in my form and the form posts back onto itself and IsPostBack is true, then SPContext.Current.List is null so I can't find the list that I need to add my stuff into.
Is this expected?
How should I retain some info about my context list across the postback? Should I just populate some asp:hidden control with my list's guid and then just pull it back from that on the postback? That seems safe, I guess.
FWIW, this is the MOSS 2007 Standard version.
Generally speaking I try and copy whatever approach the product group has taken when looking to add functionality of my own. In this case they add their own edit/view/add pages via the list definition itself.
I built a solution that also needed its own custom "New" form, not open source unfortunately, though if you are interested you can download it, its called "Tagged Links" (Social Bookmarking for SharePoint) and you can find some links on my blog.
To give you a few hints and tips, the following should set you off in the right direction:
Created a new list definition.
Created a new Content Type In the content type you can define your own "FormTemplates" that references a Rendering Template which determine what gets displayed in the "Middle" bit of those forms.
Copied the standard Rendering Template, but then made the changes to it that I
needed.
Wrapped it all up in a solution, and deployed.
My Rendering Template actually included an overridden "Save" Button where I did a lot of the extra work I needed to do during the save.
Anyway, it is a little too much work in my opinion but, I think, it most closely matches the standard approach taken by the product developers. Let me know if you need more detail and I will see if I can put together a step-by-step blog post, but hopefully this gets you off on the right direction.
I would be surprised if you could do something in a _Layouts file that you can't do in a forms template. You have pretty much the same technologies at your disposal.
Looking at the way SharePoint works with ListItems and Layouts pages (for example "Manage Permissions" on a list item), I can see that they pass some variables in via querystrings:
?obj={76113B3A-FABA-4389-BC85-4BB2CC5AB423},6,LISTITEM&List={76113B3A-FABA-4389-BC85-4BB2CC5AB423}
Perhaps they grab the context back each time programmatically using these values.
I'm not using a custom "new form", so this might not apply. I added an event receiver to my custom content type and then do my custom code in the ItemAdded or ItemAdding events. This code fires when the event is added to a list. You can use the event receiver properties to get to the parent List, Web, and Site.
I'd like to think my issue is "special" here, since I am using a custom form. I chose to use a custom form rather than a custom FormTemplate simply because I'm doing a lot of stuff that's not very SharePoint list-like (making ajax calls to get info from a third-party app then generating some dynamic form elements based on that ajax result, then subsequent processing of that data on postback). I thought it'd be a nightmare to try this within the usual custom rendering template mechanism.
I also don't think I can supply the custom form declarations in the list definition itself, because I have multiple content types associated with this list, and each content type has its own custom form (the other type is thankfully much simpler).
Actually, my simple way of keeping the list guid in my hidden field was a very low impact way to address this specific problem. My main concern is that I'm not sure why the SPContext just loses all its usefulness when I postback here, which makes me think I'm doing something wrong.

Resources