ఒక గ్రిడ్లో కంటెంట్ ప్రశ్న వెబ్ పార్ట్ ఫలితాలను ప్రదర్శించడానికి / టేబుల్

ఓవర్వ్యూ అండ్ ఆబ్జెక్టివ్

అవుట్ ఆఫ్ ది బాక్స్, MOSS’ కంటెంట్ ప్రశ్న వెబ్ పార్ట్ (CQWP) ఒక జాబితా రూపంలో దాని ఫలితాలను చూపిస్తుంది, similar to search results. It is also possible to display the results in a grid format (ఉదా. HTML పట్టిక ఫార్మాట్). Grid formats are better in some circumstances. I describe how to achieve that effect in this article.

వ్యాపారం దృశ్య

I have worked with a client on an enterprise-wide MOSS rollout. We have designed their taxonomy such that projects are first class citizens in the hierarchy and have their own top level site. Project managers maintain a singleton list of project summary information, శీర్షిక వంటి, బడ్జెట్, పూర్తి కాగలదనే, remaining budget and other summary type fields. By "singleton" I mean a custom SharePoint list guaranteed to contain only one item. Simplistically, ఈ అనిపిస్తోంది:

ప్రతిమ

వివరించినట్లు సాంకేతిక విధానం మాదిరిగానే ఉంటుంది ఇక్కడ (http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!447.entry). The CQWP uses an XSL transform to emit HTML for the browser to render.

I always envision the result before diving into the XSL because XSL is a nightmare. Here’s my desired result:

ప్రతిమ

ఈ వంటి HTML ఫలితంగా ఉత్పత్తి:

<html>
 <శరీరం>
 <సెంటర్>
 <పట్టిక అంచు= 1>

<!-- Labels ->
 <tr bgcolor= నీలం>
 <td><ఫాంట్ రంగు= తెలుపు><బి>ప్రాజెక్ట్ పేరు</బి></ఫాంట్></td>
 <td నిలబెట్టు= కుడి><ఫాంట్ రంగు= తెలుపు><బి>తేదీ పూర్తి</బి></ఫాంట్></td>
 <td నిలబెట్టు= కుడి><ఫాంట్ రంగు= తెలుపు><బి>బడ్జెట్</బి></ఫాంట్></td>
 <td నిలబెట్టు= కుడి><ఫాంట్ రంగు= తెలుపు><బి>అసలు ఖర్చు</బి></ఫాంట్></td>
 <td><ఫాంట్ రంగు= తెలుపు><బి>మొత్తం స్థితి</బి></ఫాంట్></td>
 </tr>

<tr>
 <td>Re-వైర్ కంప్యూటర్ గది.</td>
 <td నిలబెట్టు= కుడి>02/01/08</td>
 <td నిలబెట్టు= కుడి>22,500.00</td>
 <td నిలబెట్టు= కుడి>19,000.00</td>
 <td>ప్రోగ్రెస్ లో</td>
 </tr>

<tr>
 <td>SQL అప్గ్రేడ్ ఏర్పాటు సర్వర్లు</td>
 <td నిలబెట్టు= కుడి>04/01/08</td>
 <td నిలబెట్టు= కుడి>7,500.00</td>
 <td నిలబెట్టు= కుడి>0.00</td>
 <td>ప్రణాళిక</td>
 </tr>

</పట్టిక>
 </సెంటర్>
 </శరీరం>
</html>

విధానం

గ్రిడ్ సృష్టించడానికి ఈ దశలను అనుసరించండి:

  1. గ్రిడ్ భాగాలను గుర్తించండి (వరుసలు / నిలువరుసలను).
  2. అవసరమైన సైట్ నిలువు నిర్వచించండి మరియు సృష్టించడానికి.
  3. ప్రాజెక్టులు మరియు సింగిల్టన్ జాబితాలు ఉప సైట్లు సృష్టించు.
  4. ఒక వెబ్ పేజీకి CQWP వేసి మీ జాబితాలు శోధించడానికి ఇది కాన్ఫిగర్.
  5. అదనపు నిలువు అప్ సేకరించడానికి CQWP యొక్క XML సవరించు.
  6. ఒక పట్టిక తయారు చేయడానికి XSL సవరించు.

I’m going to concentrate on number six. Numbers one through four are straight-forward and something that any CQWP user has already done. Number five has been well-documented by others including this exhaustive screen-shot laden article from MSDN ఇక్కడ (http://msdn2.microsoft.com/en-us/library/bb897399.aspx) మరియు హీథర్ సాల్మన్ బ్లాగ్ ఇక్కడ (http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx).

నట్స్ మరియు బోల్ట్స్

దశలను MSDN డాక్యుమెంటేషన్ మరియు హీథర్ సాల్మన్ వ్యాసం ప్రకారం ఐదు ఒకటి ప్రారంభం మరియు అమలు.

ఈ సమయంలో, మీరు పేజీ మీ CQWP జోడించిన మరియు మీరు మీ <CommonViewFields> అవసరమైన వలె కాన్ఫిగర్.

సాధారణ దశలను అనుసరించడం, నేను ఈ మధ్యంతర ఫలితాలను పొందండి:

1. ఒక కంటెంట్ రకాన్ని సృష్టించు, a templatized custom list for that content type and two sites. Here is the content type:

ప్రతిమ

ఇక్కడ సైట్ నిర్మాణం:

ప్రతిమ

2. నా ప్రాజెక్ట్ subsites మరియు సింగిల్టన్ ప్రాజెక్ట్ సారాంశం జాబితాలు సృష్టించిన తరువాత CQWP జోడించు:

ప్రతిమ

3. ద్వారా నేను మీరు అన్ని అదనపు సమాచారాన్ని జోడించండి <CommonViewFields>:

        <ఆస్తి పేరు="CommonViewFields" రకము="తీగ">Project_x0020_Name;Project_x0020_Expenses;Project_x0020_Status;Project_x0020_Start_x0020_Date;Project_x0020_End_x0020_Date;Project_x0020_Budget</ఆస్తి>

నేను ఒక లైన్ లో అన్ని ఆస్తి ఖాళీలను ఉంచాలని ఉంది గమనించండి లేదా అది పని కాదు (CQWP ప్రశ్న ఏ ఐటంలు తిరిగి నాకు తెలియచేయును).

4. ఈ సమయంలో, we’re ready to move beyond the MSDN article and flip on over to Heather Solomon’s article. Follow her steps starting near step #5 మలచుకొనిన సృష్టించడానికి / unghosted version of ItemStyle.xsl. I follow Heather’s advice, అడుగు ద్వారా అప్ 11 మరియు ఈ మధ్యంతర ఫలితాలను పొందండి:

4.1: నా XSL టెంప్లేట్ క్రింది పేరు:

<XSL:template name="Grid" match="Row[@Style=’Grid’]" mode="itemstyle">

నేను కూడా కొద్దిగా ఆమె సూచించారు సవరించండి <XSL:-ప్రతి కోసం …> ఒక జోడించడం ద్వారా <br /> ఒక క్లీనర్ జాబితా అందించడానికి ట్యాగ్:

    <XSL:-ప్రతి కోసం ఎంచుకోండి="@ *">
      పి:<XSL:విలువ యొక్క ఎంచుకోండి="పేరు()" /><br/>
    </XSL:-ప్రతి కోసం>

4.2: నేను వెబ్ భాగం సవరించండి, go to appearance and select my "Grid" శైలి:

ప్రతిమ

మార్పు వర్తించు మరియు ఇక్కడ ఫలితం:

ప్రతిమ

మేము ఖాళీలను మేము కావలసిన పైన నుండి చూడగలరు (ప్రాజెక్ట్ పేరు, ఖర్చు, హోదా, మొదలైనవి) are available for us to use when we emit the HTML. Not only that, but we see the names by which we must reference those columns in the XSL. ఉదాహరణకు, we reference Project Status as "Project_x005F_x0020_Name".

ఈ సమయంలో, మేము హీథర్ యొక్క బ్లాగు నుండి మరియు ఈ రాక్షసుల భుజాల నుండి బయలుదేరి, నేను నా స్వంత కొద్దిగా జోడించండి.

ContentQueryMain.xsl

గుర్తు: రెండు ContentQueryMain.xsl మార్పులతో అలాగే ItemStyle.xsl ఉన్నప్పుడు, మీరు మీ మార్పులను ప్రభావం చూడండి ముందు మీరు తిరిగి సదరు ఫైళ్లను తనిఖీ అవసరం.

గ్రిడ్ తయారీ ప్రయోజనాల కోసం, MOSS uses two different XSL files to produce the results we see from a CQWP. To generate the previous bit of output, we modified ItemStyle.xsl. MOSS actually uses another XSL file, ContentQueryMain.xsl to in conjunction with ItemStyle.xsl to generate its HTML. As its name implies, ContentQueryMain.xsl is the "main" XSL that controls the overall flow of translation. It iterates through all the found items and passes them one by one to templates in ItemStyle.xsl. We’ll modify ItemStyle.xsl to generate the open <పట్టిక> డేటా మొదటి వరుసలో వెలువరించే ముందు ట్యాగ్ మరియు ముగింపు <పట్టిక> tag after emitting the last row. To accomplish this, ContentQueryMain.xsl is modified to pass two parameters to our "grid" ItemStyle.xsl లో టెంప్లేట్, "last row" and "current row". ItemStyle.xsl uses these to conditionally emit the necessary tags.

హీథర్ సాల్మన్ సాంకేతికతను ఉపయోగించి, we locate ContentQueryMain.xsl. It is located in the same place as ItemStyle.xsl. This screen shot should help:

ప్రతిమ

మేము క్రింది మార్పులు అవసరం:

  • ఒక XSL టెంప్లేట్ సవరించు, "CallItemTemplate" that actually invokes our Grid template in ItemStyle.xsl. We will pass two parameters to the Grid template so that it will have the data it needs to conditionally generate opening and closing <పట్టిక> టాగ్లు.
  • Modify another bit of ContentQueryMain.xsl that calls the "CallItemTemplate" to pass it a "LastRow" LastRow మా గ్రిడ్ టెంప్లేట్ వారికి ఉండవచ్చు పారామితి తద్వారా.

Locate the template named "OuterTemplate.CallItemTemplate" స్ట్రింగ్ ద్వారా గుర్తి:

  <XSL:టెంప్లేట్ పేరు="OuterTemplate.CallItemTemplate">

ఈ క్రింది విధంగా మొత్తం టెంప్లేట్ భర్తీ:

  <XSL:టెంప్లేట్ పేరు="OuterTemplate.CallItemTemplate">
    <XSL:PARAM పేరు="CurPosition" />

    <!--
      Add the "LastRow" పారామితి.
      We only use it when the item style pass in is "Grid".
    -->
    <XSL:PARAM పేరు="LastRow" />

    <XSL:ఎంచుకోండి>
      <XSL:ఉన్నప్పుడు పరీక్ష="@ శైలి = 'NewsRollUpItem'">
        <XSL:-టెంప్లేట్లు దరఖాస్తు ఎంచుకోండి="." మోడ్="itemstyle">
          <XSL:తో PARAM పేరు="EditMode" ఎంచుకోండి="$cbq_iseditmode" />
        </XSL:-టెంప్లేట్లు దరఖాస్తు>
      </XSL:ఉన్నప్పుడు>
      <XSL:ఉన్నప్పుడు పరీక్ష="@ శైలి = 'NewsBigItem'">
        <XSL:-టెంప్లేట్లు దరఖాస్తు ఎంచుకోండి="." మోడ్="itemstyle">
          <XSL:తో PARAM పేరు="CurPos" ఎంచుకోండి="$CurPosition" />
        </XSL:-టెంప్లేట్లు దరఖాస్తు>
      </XSL:ఉన్నప్పుడు>
      <XSL:ఉన్నప్పుడు పరీక్ష="@ శైలి = 'NewsCategoryItem'">
        <XSL:-టెంప్లేట్లు దరఖాస్తు ఎంచుకోండి="." మోడ్="itemstyle">
          <XSL:తో PARAM పేరు="CurPos" ఎంచుకోండి="$CurPosition" />
        </XSL:-టెంప్లేట్లు దరఖాస్తు>
      </XSL:ఉన్నప్పుడు>

      <!--
              గ్రిడ్ itemstyle.xsl టెంప్లేట్ ప్రస్తుత స్థానం మరియు lastrow పాస్.
              ItemStyle.xsl ఓపెన్ మరియు ముగింపు విడుదల ఆ ఉపయోగిస్తుంది <పట్టిక> టాగ్లు.
      -->
      <XSL:ఉన్నప్పుడు పరీక్ష="@ శైలి = 'గ్రిడ్'">
        <XSL:-టెంప్లేట్లు దరఖాస్తు ఎంచుకోండి="." మోడ్="itemstyle">
          <XSL:తో PARAM పేరు="CurPos" ఎంచుకోండి="$CurPosition" />
          <XSL:తో PARAM పేరు="చివరి" ఎంచుకోండి="$LastRow" />
        </XSL:-టెంప్లేట్లు దరఖాస్తు>
      </XSL:ఉన్నప్పుడు>

      <XSL:లేకపోతే>
        <XSL:-టెంప్లేట్లు దరఖాస్తు ఎంచుకోండి="." మోడ్="itemstyle">
        </XSL:-టెంప్లేట్లు దరఖాస్తు>
      </XSL:లేకపోతే>
    </XSL:ఎంచుకోండి>
  </XSL:టెంప్లేట్>

వ్యాఖ్యలు మార్పులు ప్రయోజనం వివరించడానికి.

కోర్సు యొక్క, the "OuterTemplate.CallItemTemplate" is itself called from another template. Locate that template by searching for this text string:

<XSL:టెంప్లేట్ పేరు="OuterTemplate.Body">

OuterTemplate.Body సూచనలను స్క్రోలు మరియు LastRow పారామితి ఈ క్రింది ఇన్సర్ట్ (ఇటాలిక్స్ లో ఒక వ్యాఖ్య చూపిన):

<XSL:కాల్ టెంప్లేట్ పేరు="OuterTemplate.CallItemTemplate">
  <XSL:తో PARAM పేరు="CurPosition" ఎంచుకోండి="$CurPosition" />
  <!-- LastRow పారామితి ఇన్సర్ట్. -->
  <XSL:తో PARAM పేరు="LastRow" ఎంచుకోండి="$LastRow"/>
</XSL:కాల్ టెంప్లేట్>

ఈ అన్ని తర్వాత, మేము చివరకు విషయాలు సరిగ్గా మన ItemStyle.xsl విడుదల చేసే ఏర్పాటు <పట్టిక> కుడి ప్రదేశం వద్ద టాగ్లు.

ItemStyle.Xsl

గుర్తు: మళ్ళీ, మీరు ఈ మార్పులను ప్రభావం చూడండి తద్వారా ఏ మార్పులు చేసిన తర్వాత ItemStyle.xsl లో తనిఖీ.

మేము ఇక్కడ రెండు విధులు ఉన్నాయి:

  • Replace the entire Grid template. You can copy/paste from below.
  • Add some mumbo jumbo outside the template definition that enables "formatcurrency" template to work. (మీరు నేను XSL న అతిచిన్న హ్యాండిల్ కలిగి చెప్పవచ్చు).

మొదటి, ItemStyle.xsl పైభాగంలో, ఈ లైనును:

  <!-- మాకు U.S ప్రదర్శించడానికి అనుమతిస్తుంది కొన్ని mumbo జంబో. ద్రవ్యం. -->
  <XSL:దశాంశ ఫార్మాట్ పేరు="సిబ్బంది" అంకెల="D" />

  <XSL:టెంప్లేట్ పేరు="డిఫాల్ట్" మ్యాచ్="*" మోడ్="itemstyle">

నేను ముందు నేరుగా జోడించిన గమనిక <XSL:template name="Default" …> నిర్వచనం.

తర్వాత, go back to our Grid template. Replace the entire Grid template with the code below. It is thoroughly commented, కానీ నాకు ఇమెయిల్ సంకోచించరు లేదా మీరు ప్రశ్నలు ఉంటే నా బ్లాగులో వ్యాఖ్యలు వ్రాయటం లేదు.

  <XSL:టెంప్లేట్ పేరు="దీర్ఘచతురస్రాకారంలో ఏర్పడిన వీధులు" మ్యాచ్="వరుస[@ శైలి = 'గ్రిడ్']" మోడ్="itemstyle">

    <!--
      ContentMain.xsl CurPos మరియు చివరి వెళుతుంది.
      మేము షరతులతో ఓపెన్ మరియు ముగింపు విడుదల ఉపయోగించవచ్చు <పట్టిక> టాగ్లు.
    -->
    <XSL:PARAM పేరు="CurPos" />
    <XSL:PARAM పేరు="చివరి" />

    <!-- కింది వేరియబుల్ ప్రామాణిక ItemStyle.xsl నుండి స్థిర ఉంటాయి -->
    <XSL:అస్థిరమైన పేరు="SafeImageUrl">
      <XSL:కాల్ టెంప్లేట్ పేరు="OuterTemplate.GetSafeStaticUrl">
        <XSL:తో PARAM పేరు="UrlColumnName" ఎంచుకోండి="'ImageUrl'"/>
      </XSL:కాల్ టెంప్లేట్>
    </XSL:అస్థిరమైన>
    <XSL:అస్థిరమైన పేరు="SafeLinkUrl">
      <XSL:కాల్ టెంప్లేట్ పేరు="OuterTemplate.GetSafeLink">
        <XSL:తో PARAM పేరు="UrlColumnName" ఎంచుకోండి="'LinkUrl'"/>
      </XSL:కాల్ టెంప్లేట్>
    </XSL:అస్థిరమైన>
    <XSL:అస్థిరమైన పేరు="DisplayTitle">
      <XSL:కాల్ టెంప్లేట్ పేరు="OuterTemplate.GetTitle">
        <XSL:తో PARAM పేరు="శీర్షిక" ఎంచుకోండి="@ శీర్షిక"/>
        <XSL:తో PARAM పేరు="UrlColumnName" ఎంచుకోండి="'LinkUrl'"/>
      </XSL:కాల్ టెంప్లేట్>
    </XSL:అస్థిరమైన>
    <XSL:అస్థిరమైన పేరు="LinkTarget">
      <XSL:అయితే పరీక్ష="@ OpenInNewWindow = 'ట్రూ'" >_blank</XSL:అయితే>
    </XSL:అస్థిరమైన>

    <!--
      ఇక్కడ మేము ఒక వేరియబుల్ నిర్వచించే, "tableStart".  ఈ HTML కలిగి
      .  గమనించండి ఉంటే CurPos = 1, అది ఒక CDATA ట్యాగ్ లో HTML కలిగి.
      లేకపోతే, అది ఖాళీగా ఉంటుంది.

      tableStart విలువ ప్రతిసారీ ItemStyle ద్వారా అంటారు emited ఉంది
      .
    -->
    <XSL:అస్థిరమైన పేరు="tableStart">
      <XSL:అయితే పరీక్ష="$CurPos = 1">
        <![CDATA[
        <పట్టిక సరిహద్దు = 1>
          <tr bgcolor="blue">
            <td><font color="white"><బి>ప్రాజెక్ట్ పేరు</బి></ఫాంట్></td>
            <td align="right"><font color="white"><బి>తేదీ పూర్తి</బి></ఫాంట్></td>
            <td align="right"><font color="white"><బి>బడ్జెట్</బి></ఫాంట్></td>
            <td align="right"><font color="white"><బి>అసలు ఖర్చు</బి></ఫాంట్></td>
            <td><font color="white"><బి>మొత్తం స్థితి</బి></ఫాంట్></td>
          </tr>
        ]]>
      </XSL:అయితే>
    </XSL:అస్థిరమైన>

    <!--
      మరొక వేరియబుల్, tableEnd కేవలం ముగింపు పట్టిక ట్యాగ్ నిర్వచిస్తుంది.

      TableStart మాదిరిగా, ఇది ఎల్లప్పుడూ emited లో.  దాని విలువ ఎందుకు ఈ ఉంది
      .
    -->
    <XSL:అస్థిరమైన పేరు="tableEnd">
      <XSL:అయితే పరీక్ష="$CurPos చివరి $ =">
        <![CDATA[ </పట్టిక> ]]>
      </XSL:అయితే>
    </XSL:అస్థిరమైన>

    <!--
      ఎల్లప్పుడూ tableStart విషయాలు విడుదల.  ఈ మొదటి లేకపోతే
      , అప్పుడు మేము దాని విలువ తెలుసు
      .

      తప్పించుకున్న అవుట్పుట్ ఆపివేయి ఎందుకంటే ఉన్నప్పుడు tableStart అది ఖాళీగా లేదు, అది
      .  అయితే
      , it will generate
      stuff like "&LT;పట్టిక&GT;" instead of "<పట్టిక>".
    -->
    <XSL:విలువ యొక్క ఎంచుకోండి="$tableStart" డిసేబుల్-అవుట్పుట్-తప్పించుకున్న="అవును"/>


    <tr>
      <!--
      పి:Project_x005F_x0020_Name
      :Project_x005F_x0020_End_x005F_x0020_Date
      :Project_x005F_x0020_Budget
      :Project_x005F_x0020_Expenses
      :Project_x005F_x0020_Status
      -->
      <td>
        <XSL:విలువ యొక్క ఎంచుకోండి="@ Project_x005F_x0020_Name"/>
      </td>

      <td నిలబెట్టు="సరియైన">
        <XSL:విలువ యొక్క ఎంచుకోండి="@ Project_x005F_x0020_End_x005F_x0020_Date"/>
      </td>

      <td నిలబెట్టు="సరియైన">
        <XSL:కాల్ టెంప్లేట్ పేరు="formatcurrency">
          <XSL:తో PARAM పేరు="విలువ" 
ఎంచుకోండి="@ Project_x005F_x0020_Budget"></XSL:తో PARAM> </XSL:కాల్ టెంప్లేట్> </td> <td నిలబెట్టు="సరియైన"> <XSL:కాల్ టెంప్లేట్ పేరు="formatcurrency"> <XSL:తో PARAM పేరు="విలువ" ఎంచుకోండి="@ Project_x005F_x0020_Expenses">
</XSL:తో PARAM> </XSL:కాల్ టెంప్లేట్> </td> <td> <XSL:విలువ యొక్క ఎంచుకోండి="@ Project_x005F_x0020_Status"/> </td> <!-- కింది అన్ని విషయాలు స్పష్టం బయటకు వ్యాఖ్యానిస్తారు. అయితే, దానిని బాగు మరియు ఒక దానిని అంశాలు <td> దాని చూడటానికి         . --> <!-- <div id="linkitem" class="item"> <XSL:if test="string-length($SafeImageUrl) != 0"> <div class="image-area-left"> <a href="{$SafeLinkUrl}" target="{$LinkTarget}"> <img class="image-fixed-width" src="{$SafeImageUrl}"
alt="{@ ImageUrlAltText}"/> </ఒక> </DIV> </XSL:అయితే> <div class="link-item"> <XSL:కాల్ టెంప్లేట్
name="OuterTemplate.CallPresenceStatusIconTemplate"/> <a href="{$SafeLinkUrl}"
target="{$LinkTarget}" title="{@ LinkToolTip}"> <XSL:value-of select="$DisplayTitle"/> </ఒక> <div class="description"> <XSL:value-of select="@Description" /> </DIV> </DIV> </DIV>
--> </tr> <!-- ముగింపు పట్టిక ట్యాగ్ విడుదల. మేము గత వరుసలో లేకపోతే, ఈ ఖాళీ ఉంటుంది. --> <XSL:విలువ యొక్క ఎంచుకోండి="$tableEnd" డిసేబుల్-అవుట్పుట్-తప్పించుకున్న="అవును"/> </XSL:టెంప్లేట్> <XSL:టెంప్లేట్ పేరు="formatcurrency"> <XSL:PARAM పేరు="విలువ" ఎంచుకోండి="0" /> <XSL:విలువ యొక్క ఎంచుకోండి='ఫార్మాట్ సంఖ్య($విలువ, "$DDD,DDD,DDD.DD", "staff")' /> </XSL:టెంప్లేట్>

22 "న ఆలోచనలుఒక గ్రిడ్లో కంటెంట్ ప్రశ్న వెబ్ పార్ట్ ఫలితాలను ప్రదర్శించడానికి / టేబుల్

  1. ఆండ్రియాస్

    ఇది దాదాపు నాకు పని: నేను అవుట్పుట్ నిర్వహించేందుకు </పట్టిక> సరిగ్గా గుర్తు అంతం, కానీ ప్రారంభ టాగ్ లేదు. It seems the test="$CurPos = 1" నిజమైన తిరిగి లేదు. కానీ ఎందుకు?

  2. లిసా

    మీరు కస్టమ్ ContentQueryMain మరియు ItemStyle XSL ఫైళ్ళను సృష్టించడం తో ఏ పని చేసిన? నేను గోవా కారణం నా కస్టమ్ శైలులు ఏ పాచెస్ లేదా నవీకరణలు భర్తీ వెళ్లమని వద్దు అని. మీరు ఉదాహరణలు ఉందా? నేను శైలి లైబ్రరీ ContentQueryMain.xsl మరియు అప్లోడ్ కొత్త కస్టమ్ కాపీని యొక్క సమరూప నకలు ప్రయత్నించాము. . Webpart యొక్క MainXslLink ఆస్తి ఈ XSL ఫైలు ఒక సూచన ఉంచుతున్నాయి, నేను పొందండి 401 అధికారం లేదు. కస్టమ్ XSL ఫైలు ను మరియు ప్రతి ఒక్కరూ అది యాక్సెస్ చదివారు.

  3. గ్రెగ్ షెరిడాన్

    ఎక్కువ, ఈ పోస్ట్ ఒక నిజంగా ఉపయోగపడిందా. నేను అన్ని పని చేశారు, మరియు కూడా మైక్ బ్రౌన్ యొక్క మార్పు అమలు దీనిని కనుక
    నేను CQWB యొక్క లక్షణాలు లో పారామితి ద్వారా గ్రూప్ ఎంచుకున్న పట్టిక లోపల ఫలితాలు.
    నేను ఒక లింక్ కూడా టైటిల్ చేసిన, కాబట్టి ఇది చక్కగా పనిచేస్తుంది. నేను ఇప్పటికీ ఒక సమస్య, అయితే. నేను సైట్ పేరు ద్వారా ఫలితాలు చోట నేను. పట్టిక లోపల, చక్కగా దీనిని వాటిని, మరియు అది చాలా బాగుంది, కానీ ఇప్పటికీ అన్ని బృందం ప్రింటింగ్ లో
    పేర్లు(నా విషయంలో సైట్ పేర్లు) టేబుల్ పై. ఎవరైనా ఈ వదిలించుకోవటం ఎలా తెలుసు?
    ధన్యవాదాలు,
    గ్రెగ్

  4. సంఖ్య పేరు

    నైస్ వ్యాసం. నేను జాబితా మూలం కోడ్ విశ్లేషించడం ద్వారా నా పట్టిక డిఫాల్ట్ SharePoint జాబితా రూపాన్ని ఇవ్వాలని నిర్వహించారు. ఇక్కడ ItemStyle లో సరిపోయే అవసరమైన ప్రధాన HTML బ్లాక్స్ ఉన్నాయి:

    <TABLE width="100%" class="ms-listviewtable" border=0 cellspacing=0 cellpadding=1 dir="None">

    <!–HEADER–>
    <TR class="ms-viewheadertr" Valign = top>
    <TH nowrap scope="col" class="ms-vh2"><div style="width:100%;స్థానం:సంబంధిత;ఎడమ:0;పైన:0;">
    <TABLE style="width:100%;" CtxNum="1" height="100%" cellspacing=1 cellpadding=0 class="ms-unselectedtitle">
    <TR>
    <TD width="100%" Class="ms-vb" nowrap>
    Texte డు టిట్రే ICI

    </TD>
    <TD style="position:సంపూర్ణ;">
    </TD>
    </TR>
    </TABLE></DIV>
    </TH>

    <!–అన్ని శీర్షిక కణాలు కోసం పునరావృతం–>
    </TR>

    <!– టేబుల్ డేటా –>
    <TR class="">
    <!–డేటా కాలమ్, హైపర్ లింక్ తో మొదటి ఒక పాల్ యొక్క కోడ్ ఉపయోగించండి –>
    <TD Class="ms-vb2">ఇక్కడ డేటా</TD>

    <!–ఖాళీ కాలమ్–>
    <TD Class="ms-vb2">
    <span dir = గమనిక></వ్యవధి><
    /TD>

    <!–తేదీ కాలమ్–>
    <TD Class="ms-vb2">
    <NOBR>11/12/2008</NOBR>
    </TD>
    </TR>

    <!–***ప్రత్యామ్నాయ వరుస – ప్రస్తుత వరుస మోడ్యులో 2 ఆధారంగా ప్రత్యామ్నాయ తరగతి ఇన్సర్ట్ ఒక కొత్త XSL వేరియబుల్ ఉపయోగించండి–>
    <TR class="ms-alternating">

    </TR>
    </TABLE>

  5. మైక్ బ్రౌన్
    Zoltan,
    I was working on the same issue as you. I wanted all my items displayed in a grouped manner rather than just a lits. Here is how I achieved it.
    ContentQueryMain.xsl
    <XSL:when test="@Style=’Grid’">
    <XSL:apply-templates select="." mode="itemstyle">
    <XSL:with-param name="CurPos" select="$CurPosition" />
    <XSL:with-param name="Last" select="$LastRow" />
    <!–ఒక కొత్త గుంపు ప్రారంభించింది సూచించే పారామితి లో పాస్ ఈ కొత్త విభాగాన్ని జోడించడానికి–>
    <XSL:with-param name="StartNewGroup" select="@__begingroup" />
    </XSL:-టెంప్లేట్లు దరఖాస్తు>
    </XSL:ఉన్నప్పుడు>
    ItemStyle.xsl
    మీ పారామితి జోడించు
    <XSL:param name="StartNewGroup"/>
    డేటా మొదటి వరుసలో ఈ టెక్స్ట్ చేర్చండి
    <XSL:ఎంచుకోండి>
    <XSL:when test="$StartNewGroup = ‘True’">
    <tr>
    <td >
    <XSL:call-template name="OuterTemplate.GetGroupName">
    <XSL:with-param name="GroupName" select="@*[పేరు()= $ గ్రూప్]"/>
    <XSL:with-param name="GroupType" select="$GroupType"/>
    </XSL:కాల్ టెంప్లేట్>
    </td>
    </tr>
    </XSL:ఉన్నప్పుడు>
    <XSL:లేకపోతే>
    </XSL:లేకపోతే>
    </XSL:ఎంచుకోండి>
    This should take care of your grouping issue in your grid. Each group will now begin with a new row indicating the group name. In my solution I actually added a blank <td /> అలాగే కాబట్టి అది ఇండెంట్ డేటా లో గుంపులతో మెరుగ్గా నిలిచింది.
    Site1
    datacolumn1 datacolumn2 datacolumn3 etc

    datacolumn1 datacolumn2 datacolumn3 etc
    Site2
    datacolumn1 datacolumn2 datacolumn3 etc
    Site3

    datacolumn1 datacolumn2 datacolumn3 etc

    datacolumn1 datacolumn2 datacolumn3 etc
    మొదలైనవి.
  6. Zoltan
    పాల్ హలో,
    పోస్ట్ ధన్యవాదాలు, నేను ఒక గ్రిడ్లో నా ప్రశ్న ఫలితాలు నిర్వహించడానికి నిర్వహించేది, చాలా సహాయకారిగా ఉంటుంది. అయితే, నేను ముందుకు మరియు సైట్లు ఆధారంగా సమూహం నా ఫలితాలు ఉండాలి. సమయంలో, సైట్ పేర్లు మొదటి ఇవ్వబడ్డాయి, మరియు మాత్రమే ఒక పెద్ద గ్రిడ్ వివిధ సైట్ల నుండి అన్ని వరుసలు ఉన్నాయి సమూహం. ఈ వంటి ఏదో:
    Site1 పేరు
    Site2 పేరు
    అన్ని సైట్లకు గ్రిడ్లో డేటా
    నేను ఈ క్రింది విధంగా నా డేటా పొందడానికి సవరించడానికి ఏ ఏ ఆలోచనలు:
    Site1 పేరు
    Site1 కోసం గ్రిడ్ లో డేటా
    Site2 పేరు
    Site2 కోసం గ్రిడ్ లో డేటా
    ముందుగానే ధన్యవాదాలు,
    Zoltan
  7. పియరీ Joubert
    అద్భుతమైన పోస్ట్, నేను కలిగి నా సమస్య పరిష్కరించబడింది.
    నా మాత్రమే సమస్య AssignedTo రంగంలో ప్రదర్శితమయిన, I configure it with the "User" రంగంలో రకం మరియు దిగుమతి webpart తరువాత లోపం ప్రదర్శిస్తుంది:
    "There was an error retrieving data to display in this Web Part."
    నేను అన్ని రంగంలో రకాల ఉపయోగించి ప్రయత్నించారు, with anything other that "User" ఇది చూపించే లోపం లేదు, but it does not display anything in the field. So I am assuming the User field type is correct, so I must be missing a setting somewhere.
    ఈ ఏ ఆలోచనలు?
    Regards
    పియరీ
  8. Charftong
    గ్రేట్ పోస్ట్!!! చాలా చాలా సహాయకారిగా.
    త్వరిత ప్రశ్న, మీరు ఉనికి తో AssignedTo లేదా ModifiedBy ఖాళీలను ప్రదర్శించడం ఏ పని చేసిన? కొన్ని కారణాల కోసం, నేను CQWP ఫీల్డ్ కేటాయించిన dipslay ప్రయత్నించండి చేసినప్పుడు, it always displays with as an example "203;#Charf Tong". I cant find a way around this.
  9. జెన్నిఫర్ డేవిస్
    పాల్
    గ్రేట్ వ్యాసం, ధన్యవాదాలు. నేను చాలా పోలి ఏదో చేయడం కానీ జాబితాలో కాకుండా అంశం కంటే ప్రాజెక్ట్ ను ప్రదర్శించడానికి కావలసిన చేస్తున్నాను. ఉదాహరణకు, మేము కలిగి 25 ఉన్నత స్థాయిలో ప్రాజెక్ట్ స్థలాలు మరియు ప్రతి కంటెంట్ రకాలను జాబితా కలిగి. ఈ ప్రాజెక్ట్ పేరు ఉంటాయి, భాగము, వర్ణన. నేను ఈ డేటాను ఉపసంహరించుకునేలా కంటెంట్ ప్రశ్న వెబ్ భాగం ఉపయోగించడానికి కావలసిన మరియు URL జాబితాలో అంశం ఎంట్రీ తీసుకెళతాయి మరియు నేను నిజంగా ఇది ప్రాజెక్ట్ సైట్ నాకు తీసుకోనవసరం అప్రమేయంగా తప్ప విజయం సాధించింది. మీరు నాకు ఏ సలహాను ఇస్తుంది?
    ధన్యవాదాలు
    జెన్
  10. కీరన్ రాశాడు:

    ఎక్కువ పాల్,

    Xml / XSL మరియు కంటెంట్ ప్రశ్న వెబ్ భాగం పనిచేసేటప్పుడు, మీరు మీ XSLT ఫార్మాట్ ఏ మంచి మార్గాలు కనుగొన్నారు? మార్పులు మరియు రూపకల్పనను పరీక్షించడానికి ప్రయత్నిస్తున్న ఒక టెక్స్ట్ ఎడిటర్ ఉపయోగించి ఒక ** ఒక సరైన నొప్పి నిరూపించుకుంటోంది…

    అన్ని ఉత్తమ

  11. మైఖేల్ Dipay
    Regarding the issue I was having last time where it doesn’t display the images from the grid view but instead displays the text (https://myweb.com/Marketing/images/icn-order.gif,). నేను అనుకూల వీక్షణ సృష్టించడం మరియు నేను ప్రదర్శించడానికి కావలసిన కస్టమ్ కాలమ్లను ఎంచుకోవడం ద్వారా SharePoint డిజైనర్ సహాయంతో అది పరిష్కరించడానికి నిర్వహించండి. నేను చిత్రాలను కాలమ్ రకం URL చూపిస్తారు ఆ కనుగొన్న(కామా) (ఉదాహరణకు. https://myweb.com/Marketing/images/icn-order.gif,). ప్రస్తుత ఫార్మాట్ టెక్స్ట్ ఉంది, నేను సాధారణ XSL నుండి చిత్రం దానిని మార్చడానికి కలిగి:విలువ యొక్క విధుల -> చిత్రంగా ఫార్మాట్. నేను చూపించు కోరుకున్నాడు కస్టమ్ చిత్రాలను ఈ మార్పు ప్రదర్శన. నేను చిత్రం చూపించడానికి కోడ్ కాపీ ( <img సరిహద్దు ="0" src="{substring-ముందు(@ IcnOrder, ', ')}" /> ) And in the ItemStyle.xsl file I have to change the @PICTURECOLUMNNAME to the code <img సరిహద్దు ="0" src="{substring-ముందు(@ IcnOrder, ', ')}" /> . అప్పుడు సేవ్. ఇప్పుడు నా పట్టిక గ్రిడ్ ఫలితాలు టెక్స్ట్ అలాగే కస్టమ్ చిత్రాన్ని రకం నిలువు చూపించడానికి.
  12. హెలెన్
    ఎక్కువ పాల్,
    గొప్ప వ్యాసం ధన్యవాదాలు!
    మీరు నియమబద్ధ ఆకృతీకరణ పేర్కొన్నారు – "You can also put in conditional formatting, such as displaying projects who have exceeded their budget in red." Do you happen to have a code example for that?
    ధన్యవాదాలు మళ్ళీ!
    హెలెన్
  13. మైఖేల్ Dipay
    ఎక్కువ పాల్,
    It was a great article and was able to generate the same results as expected. నేను దాని నిలువు ఒకటిగా గ్రిడ్లో ఒక చిత్రం చూపించడానికి అవసరం ఉన్నట్లు. ఇది గ్రిడ్లో చిత్రం ప్రదర్శించడం లేదు కానీ బదులుగా URL తో చిత్రం ప్రదర్శిస్తుంది (,) చివరిలో కామా.
    (ఉదాహరణకు. https://myweb.com/Marketing/images/icn-order.gif, )
    నేను CommonViewFields ఫీల్డ్ పద్ధతి లో చిత్రం లేదా చిత్ర వాడాలి? (ఉదాహరణకు. InternalColumnName, ప్రతిమ)
    ధన్యవాదాలు,
    మైక్
  14. Saji Ijiyemi

    Your post is exactly what I was looking for. అయితే, I can’t get it to work.

    I have documents that are stored in various doc. libraries but classified using a custom class column (ఎంపిక: 1 లేక 2. I want to use CQWP to show these documents based on thier class.
    I was able to add the CQWP, export it to SPD, configure the itemStyle.xls to show custom fileds in list view. అయితే, I could not successfully implement what you describe here.

    These are the columns I want to show in my CQWP:

    File Type (to show icon)
    File Title
    Date Last Modified
    Modified By Who
    Checked Out To
    Checked In Comments

    I currently have the result in a list format. How do I change it to a talble format.

    ధన్యవాదాలు.

    Saji

ఒక Reply వదిలి మైఖేల్ Dipay ప్రత్యుత్తరం రద్దు

మీ ఇమెయిల్ చిరునామా ప్రచురితమైన కాదు. లు గుర్తించబడతాయి *