The Content Query webpart Moss provides a great webpart.
Simple Customization
Figure 1 this effect uses two webparts
Title is the content editing webpart.
Content is Content Query webpart
2 places to be modified
Modify the. webpart file (after exporting the Content Query webpart, modify it)
1. Export "Content Query webpart. webpart", click the Web Part editing drop-down button, and export
2. Open "Content Query webpart. webpart" in notepad, edit the attribute commonviewfields, and save the following:
<Property name = "commonviewfields" type = "string"> title, text; modified, datetime </property>
Separate the middle line of multiple fields with semicolons
Front field, Back Type
Modify the. itemstyle. XSL style file to render and format data.
Find itemstyle.xls
Create an XSL: Template
<XSL: Template Name = "AA" match = "row [@ style = 'aa']" mode = "itemstyle">
<XSL: variable name = "safelinkurl">
<XSL: Call-Template Name = "outertemplate. getsafelink">
<XSL: With-Param name = "urlcolumnname" select = "'linkurl'"/>
</XSL: Call-template>
</XSL: Variable>
<XSL: variable name = "safeimageurl">
<XSL: Call-Template Name = "outertemplate. getsafestaticurl">
<XSL: With-Param name = "urlcolumnname" select = "'imageurl'"/>
</XSL: Call-template>
</XSL: Variable>
<XSL: variable name = "displaytitle">
<XSL: Call-Template Name = "outertemplate. gettitle">
<XSL: With-Param name = "title" select = "@ title"/>
<XSL: With-Param name = "urlcolumnname" select = "'linkurl'"/>
</XSL: Call-template>
</XSL: Variable>
<XSL: variable name = "linktarget">
<XSL: If test = "@ openinnewwindow = 'true'"> _ blank </XSL: If>
</XSL: Variable>
<Div id = "linkitem" class = "item">
<XSL: If test = "string-length ($ safeimageurl )! = 0 ">
<Div class = "image-area-Right">
<A href = "/{substring-after ($ safelinkurl, '//'), '/')}" target = "{$ linktarget}">
</A>
</Div>
</XSL: If>
<Div class = "link-item">
<XSL: Call-Template Name = "outertemplate. callpresencestatusicontemplate"/>
<Table Style = "width: 95%">
<Tr>
<TD> </TD>
<TD style = "width: 60%">
<A href = "{$ safelinkurl}" target = "{$ linktarget}" Title = "{@ linktooltip}">
<XSL: value-of select = "Concat (substring ($ displaytitle, 1, $ titlelength), '...')"/>
</A>
</TD>
<TD align = "Left">
<Div class = "Description">
<XSL: value-of select = "ddwrt: formatdatetime (string (@ modified), 1033, 'yyyy-mm-dd')"/>
</Div>
</TD>
</Tr>
</Table>
</Div>
</Div>
</XSL: Template>
The key point is represented by a red field, where the style is modified.
Save it to the style Library and release it.
Then, import the modified Content Query webpart to the webpart library.
Then add the Content Query webpart to the page. Select AA in the project style to see the effect ..