Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm using SharePoint 2007, custom list.

I have created 2 content type on that list. on the home page I create 2 web part. I want that each content type appear in one web part.

is it possible?

share|improve this question
    
Custom list is on same site as homepage? –  Vedran Rasol Jul 27 '11 at 11:57
add comment

2 Answers 2

If I understand your question, it can be done this way.

Create two views on the custom list, one for each content type (lets call them ContentA and Content B). In the Filter section of the view, select the "show items only when the following is true" radio button. Set the dropdown for Content Type, 'is equal to' and enter the name of your content type into the text box. Save the view. Repeat this for content type ContentB. enter image description here

On the home page, add one webpart that shows the first content type by setting the view in the properties of the webpart. Do the same for the other webpart so that it points to the other view.

share|improve this answer
    
This only works if list is on same site as home page. Creating views on custom list is not needed since you can define them in webpart. But generally your answer is ok. –  Vedran Rasol Jul 27 '11 at 12:01
3  
True. I usually create them in the list so they are reusable. –  Rich Ross Jul 27 '11 at 12:04
    
Good answer Rich –  Jaap Vossers Jul 27 '11 at 12:28
    
Hi! thank for your serious answer. I want to use content type in-order to avoid using view, becuse I want implement the next thing: when I make change in the default view- the main content type (such as: remove / add column) all other content-type will change to. is it possible? –  liron Jul 27 '11 at 12:33
    
If you remove a column from the base content type of ContentA and ContentB, the column will also be removed from their views. However adding a column to the base content type will not add it to these views. These would need to be done manually. How often do you anticipate adding and removing columns? –  Rich Ross Jul 27 '11 at 13:02
show 1 more comment

If you need to query outside of the site or site collection that the list exists in (which you might, gathered the comment on Rich answer), you also have the option of using a Fixed Keyword Query in a Search Core Results web part.

You can use managed properties for your keyword query, eg ContentType:"My ContentType"

Paul Galvin have an example of just that here.

share|improve this answer
    
Anders, I've followed you explanation and used the Fixed Keyword Query in the search core results web part as also described on Paul Gavin's example. However it returns ALL the itemswith my custom content type. I've selected User Query 2 in "Cross-Web Part query ID" as explained in Paul's article. Is it a normal behaviour to return ALL results or should it only return results matching my query ? /search/Pages/results.aspx?k=buy I've used ContentType:"My Custom CT" but haven't added another column name to narrow my query like (e.g. ContentType:"Training invoice" TrainingInvoiceNumber:1111) - so –  user15030 Feb 27 '13 at 17:37
    
A fixed query is just that: fixed! You predefine your search query, so the query string (?k=xx) is completely ignored –  Anders Rask Feb 28 '13 at 12:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.