How to make a custom Item Style for use with Content Query Web Part (SharePoint 2007)

Posted on 2011-05-09
Last Modified: 2012-05-11
Good afternoon All,

I am in need of some assistance.  I am trying to modify the ItemStyles file to make a custom view for use with the Conten Query Web Part (CQWP).  The back-story would be: Using the News default publishing template, I would like to display the latest news title and the complete body of the news article.  I have seen on sites where they have done it to display the first 200 characters, but I need to know if it is possible to display the whole article's body.  If it is possible, please help me with understanding how to do so.

I have attached my existing ItemStyle doc for your review.
Question by:hpmhelpdesk
    LVL 7

    Accepted Solution

    I have done the same thing for the blog posts and it wont be much different for news either. you will be quering news site rather than blog site  .
    you can use the first post by Matthew , he has done a great job . Inorder to show the full news (not 200 words ) dont use that code and specify any limit. Take a look at the links and let me know if that helps .

    same thing can be done in 2010 also its  not much different than 2007 .

    Author Comment

    Thank You Ufaroog for your post.  I was able to find those resources prior to opening this question.  I couldn't figure out how to modify the code for the news article.  Also, when I copied the code into my itemstyle file, it caused the other CQWP's to have an error and not display what it had been.

    If you could assist further I would greatly appreciate it.

    Author Closing Comment

    Thank You, after taking a rest and coming back to it I was able to figure out what to do.  I had to change the body field to PublishingPageContent.  I also had to make the correct changes to the modified webpart file

    Thank you again.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
    I have just recently built a new SharePoint 2007 farm on a complete Windows 2008 R2 server platform and part of my standard build procedure is to implement a warm up routine, usually in the form of a script that is scheduled every morning to launch …
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now