Teeb rooj txheej Query Web site qhov ntsiab hauv ib ib daim phiaj / Lub rooj

Txheej txheem cej luam thiab lub hom phiaj

Mus rau ntawm lub box, NTXHUAB’ Cov lus nug qhov Web Tshooj (CQWP) nws tau qhia nyob rau hauv ib daim ntawv teev hom, zoo li mus nrhiav tau. Nws tseem tau los tso saib qhov txheeb xyuas tau ib daim phiaj hom ntawv (i.e. Hom ntawv rooj HTML). Yog tawm tswv yim daim phiaj rau tej yam zoo. Kuv piav li cas after ntawd nyhuv hauv no Tshooj.

Lag luam Scenario

Kuv tau ua hauj lwm nrog ib tug neeg rau ib tug thoob plaws enterprise NTXHUAB rollout. Peb muaj tsim lawv taxonomy xws tias tej yaam num yog thawj class pej xeem nyob hauv lub hierarchy thiab muaj nyias qhov chaw saum theem. Yog ib qhov tswj khaws ib daim ntawv teev singleton uas yog ib qhov kev qhia, xws li lub npe, nyiaj txiag, cov kev tsim tiav tas hnub, nyiaj ntxiv thiab lwm yam kev teb. Yog "singleton" Kuv yog ib tug kev cai SharePoint sau guaranteed tau muaj cov yam khoom no tsuas muaj ib. Simplistically, nws zoo li no:

duab

Txoj kev mus kom ze yog npaum li cas tau tib yam li koj piav ntawm no (http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!447.entry). Cov CQWP siv ib XSL transform kom emit HTML rau qhov browser mus kav.

Ib txwm kuv envision hom kab mob qhov tshwm sim ua ntej nyiab loj mus rau lub XSL vim XSL yog ib tug npau suav phem. Ntawm no yog kuv yam tshwm sim:

duab

HTML li no generates uas raug:

<html>
 <lub cev>
 <chaw>
 <cov lus ciam teb= 1>

<!-- Hmong-->
 <tr bgcolor= xiav>
 <Td><Font xim= dawb><b>Qhov project Name</b></Font></Td>
 <Td dlhos= txoj cai><Font xim= dawb><b>Sau rau hnub tim</b></Font></Td>
 <Td dlhos= txoj cai><Font xim= dawb><b>Nyiaj txiag</b></Font></Td>
 <Td dlhos= txoj cai><Font xim= dawb><b>Cov nqi</b></Font></Td>
 <Td><Font xim= dawb><b>Zuag qhia tag nrho cov txheej xwm</b></Font></Td>
 </tr>

<tr>
 <Td>Rov wire computer chav.</Td>
 <Td dlhos= txoj cai>02/01/08</Td>
 <Td dlhos= txoj cai>22,500.00</Td>
 <Td dlhos= txoj cai>19,000.00</Td>
 <Td>Dauv</Td>
 </tr>

<tr>
 <Td>Ntaub ntawv servers rau SQL Upgrade</Td>
 <Td dlhos= txoj cai>04/01/08</Td>
 <Td dlhos= txoj cai>7,500.00</Td>
 <Td dlhos= txoj cai>0.00</Td>
 <Td>Los</Td>
 </tr>

</cov lus>
 </chaw>
 </lub cev>
</html>

Mus kom ze

Ua raws li cov kauj ruam yuav tsim tau rau daim phiaj:

  1. Taw rau Cheebtsam ntawm hauv daim phiaj (natwm/txhua).
  2. Txhais kom meej thiab tsim nyog kawm ntawv txhua.
  3. Tsim cov chaw sub rau qhov tej yaam num thiab singleton npe.
  4. Ntxiv ntawm CQWP mus rau ib qhov web page thiab configure mus nrhiav koj lub npe.
  5. Hloov cov CQWP XML sau mus rau txhua yam.
  6. Hloov tus XSL yuav ua tau kom muaj ib lub rooj.

Kuv yuav mloog zoo hauv tus xovtooj rau. Ib ntawm plaub numbers ncaj nraim thiab tej yam uas muaj neeg siv CQWP twb tau. Naj npawb 5 lawm documented zoo los ntawm lwm tus xws li no exhaustive txhaj tshuaj ntsuam laden Tshooj ntawm MSDN ntawm no (http://msdn2.microsoft.com/en-us/library/bb897399.aspx) thiab Heather tus Xatau-ntoos lub blog ntawm no (http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx).

Ceev And Bolts

Pib thiab kev nrhiav ib tug los ntawm as per rau cov ntaub ntawv MSDN thiab Heather tus Xatau-ntoos lub Tshooj tsib.

Thaum no tus taw tes, koj twb ua ntxiv koj CQWP mus rau sab thiab koj muaj koj <CommonViewFields> configured li tsim nyog.

Raws li cov kauj ruam li ib txwm, Kuv txais tau kev kuaj intermediate:

1. Tsim ib cov hom, templatized kev cai sau ntawd cov hom thiab ob qhov chaw. Ntawm no yog cov hom:

duab

Ntawm no yog qhov chaw qauv:

duab

2. Ntxiv rau qhov CQWP tom qab tsim kuv ib qhov subsites thiab singleton yog ib qhov kev npe:

duab

3. Ntxiv tag nrho cov ntxiv kuv xav tau ntawm cov <CommonViewFields>:

        <khoom lub npe="CommonViewFields" hom="hlua">Project_x0020_Name;Project_x0020_Expenses;Project_x0020_Status;Project_x0020_Start_x0020_Date;Project_x0020_End_x0020_Date;Project_x0020_Budget</khoom>

Ceeb toom tias kuv tau ua kom tag nrho cov cuab yeej teb ntawm ib tug kab los nws yuav tsis ua hauj lwm (CQWP xav qhia kuv tias cov lus nug rov qab tsis khoom).

4. Thaum no tus taw tes, mov kom dhau MSDN tsab xov xwm thiab flip ntawm nyob rau tshooj Heather tus Xatau-ntoos lub. Ua raws li nws cov kauj ruam pib ze rau ruam #5 los ua ib customized / unghosted version of ItemStyle.xsl. Kuv ua raws li cov lus qhia txog tus Heather, saum ntawm cov kauj ruam 11 thiab tau kuaj intermediate:

4.1: Kuv tus XSL template npe raws li nram no:

<xsl:Template npe = "daim phiaj" phim = "tshais[@Style = 'Daim phiaj']" hom = "itemstyle">

Kuv yuav ib nyuag kuj hloov nws pom tias <xsl:rau-ib …> yog muab ib <br /> lossis mus muab tov:

    <xsl:rau-ib xaiv="@*">
      P:<xsl:tus nqi-ntawm xaiv="lub npe()" /><br/>
    </xsl:rau-ib>

4.2: Kuv hloov hauv cov qhov Web site, mus zoo li thiab xaiv daim kuv "phiaj" style:

duab

Ntawm no yog cov siv qhov kev hloov thiab kev pab:

duab

Peb pom tau ntawm qhov saum no uas teb peb xav (Peb tes num lub npe, nqi, xwm txheej, yam) yog muaj nyob rau peb siv thaum peb emit cov HTML. Tsis tas li ntawd, peb pom cov npe uas peb yuav tsum reference cov txhua hauv lub XSL. Piv txwv, peb reference Project txheej xwm li "Project_x005F_x0020_Name".

Thaum no tus taw tes, peb ncaim ntawm Heather tus blog thiab ntawm lub lub xub pwg nyom ntawm no giants, Kuv tus kheej lub ntsis ntxiv kuv.

ContentQueryMain.xsl

CEEB TOOM: Thaum muaj kev hloov rau ob ContentQueryMain.xsl li no ItemStyle.xsl, koj yuav tau xyuas cov ntaub ntawv qaum rau ua ntej koj mus ntsib cov nyhuv koj hloov.

Mus rau daim phiaj vaj, NTXHUAB siv ob yam XSL ntaub ntawv los ua cov ntsiab peb pom los ntawm ib tug CQWP. Meskas tus me ntsis dhau los tso zis ntau lawm, peb hloov ItemStyle.xsl. NTXHUAB yeej siv lwm daim ntawv XSL, ContentQueryMain.xsl yuav nyob tau nrog ItemStyle.xsl Meskas cov HTML. Raws li implies lub npe, ContentQueryMain.xsl yog "loj lub" XSL controls qhov txaus zuag qhia tag nrho cov neeg txhais lus. Nws iterates kev los ntawm tag nrho cov kabmob khoom thiab kis tau ib tug los ntawm ib tug mus templates hauv ItemStyle.xsl. Peb mam li hloov ItemStyle.xsl Meskas tus qhib <cov lus> lossis ua ntej emitting rau thawj kab ntawv thiab kaw <cov lus> lossis tom qab emitting rau kab kawg. Yuav ua kom tiav no, ContentQueryMain.xsl hloov mus rau kis ob tug tsis tau rau daim peb "phiaj" Template hauv ItemStyle.xsl, "lub xeem leej" thiab "leej tam sim no". ItemStyle.xsl siv no rau conditionally emit tus cim npe tsim nyog.

Siv cov txheej txheem Heather tus Xatau-ntoos lub, Peb nrhiav ContentQueryMain.xsl. Nws nyob hauv qhov chaw qub li ItemStyle.xsl. Qhov tshuaj ntsuam txhaj yuav pab:

duab

Peb yuav tau ua cov nram qab no hloov:

  • Hloov ib tus xsl template, "CallItemTemplate" uas tau invokes peb daim phiaj template hauv ItemStyle.xsl. Peb yuav kis tau ob tsis mus rau daim phiaj template kom nws yuav muaj cov ntaub ntawv uas nws xav kom neeg conditionally qhib thiab kaw <cov lus> cim npe.
  • Hloov dua me ntsis uas hu ua "CallItemTemplate lub ContentQueryMain.xsl" yuav kis tau "LastRow ib" parameter kom cov LastRow uas tau kis rau peb cov template daim phiaj.

Nrhiav tus template npe hu ua "OuterTemplate.CallItemTemplate" qhia los ntawm cov hlua:

  <xsl:Template lub npe="OuterTemplate.CallItemTemplate">

Tag nrho cov template hloov raws li nram no:

  <xsl:Template lub npe="OuterTemplate.CallItemTemplate">
    <xsl:param lub npe="CurPosition" />

    <!--
      Ntxiv "LastRow cov" parameter.
      Peb tsuas siv cov khoom style pass hauv yog "Daim phiaj".
    -->
    <xsl:param lub npe="LastRow" />

    <xsl:xaiv>
      <xsl:Thauj tw ntsuam xyuas="@Style = 'NewsRollUpItem'">
        <xsl:thov templates xaiv="." hom="itemstyle">
          <xsl:nrog param lub npe="EditMode" xaiv="$cbq_iseditmode" />
        </xsl:thov templates>
      </xsl:Thauj tw>
      <xsl:Thauj tw ntsuam xyuas="@Style = 'NewsBigItem'">
        <xsl:thov templates xaiv="." hom="itemstyle">
          <xsl:nrog param lub npe="CurPos" xaiv="$CurPosition" />
        </xsl:thov templates>
      </xsl:Thauj tw>
      <xsl:Thauj tw ntsuam xyuas="@Style = 'NewsCategoryItem'">
        <xsl:thov templates xaiv="." hom="itemstyle">
          <xsl:nrog param lub npe="CurPos" xaiv="$CurPosition" />
        </xsl:thov templates>
      </xsl:Thauj tw>

      <!--
              Tshaj xav tam sim no thiab cov lastrow rau ntawm daim phiaj itemstyle.xsl template.
              ItemStyle.xsl yuav siv uas emit rau txoj kev qhib thiab kaw <cov lus> cim npe.
      -->
      <xsl:Thauj tw ntsuam xyuas="@Style = 'Daim phiaj'">
        <xsl:thov templates xaiv="." hom="itemstyle">
          <xsl:nrog param lub npe="CurPos" xaiv="$CurPosition" />
          <xsl:nrog param lub npe="Kav" xaiv="$LastRow" />
        </xsl:thov templates>
      </xsl:Thauj tw>

      <xsl:txwv tsis pub>
        <xsl:thov templates xaiv="." hom="itemstyle">
        </xsl:thov templates>
      </xsl:txwv tsis pub>
    </xsl:xaiv>
  </xsl:Template>

Cov lus qhia txog lub hom phiaj ntawm qhov kev hloov.

tau mas, "OuterTemplate.CallItemTemplate cov" nws tus kheej yog hu los ntawm lwm template. Nrhiav tus template ntawm searching rau qhov ntawv txoj hlua:

<xsl:Template lub npe="OuterTemplate.Body">

Scroll los ntawm cov lus qhia nyob rau hauv OuterTemplate.Body thiab cov LastRow parameter ntxig raws li nram no (qhia raws li ib tug saib nyob rau hauv italics):

<xsl:hu-template lub npe="OuterTemplate.CallItemTemplate">
  <xsl:nrog param lub npe="CurPosition" xaiv="$CurPosition" />
  <!-- Ntxig rau LastRow parameter. -->
  <xsl:nrog param lub npe="LastRow" xaiv="$LastRow"/>
</xsl:hu-template>

Tom qab nov tag nrho, peb thaum kawg muaj yam teeb zoo zoo kom peb cov ItemStyle.xsl muaj emit <cov lus> cim npe rau qhov chaw uas koj txoj kev.

ItemStyle.Xsl

CEEB TOOM: Dua, nyob ItemStyle.xsl kos tom qab hloov yam koj pom cov nyhuv uas cov kev pauv.

Peb muaj tus ob tug paub tab ntawm no:

  • Hloov hauv koj daim phiaj template. Koj tau daim ntawv/muab tshuaj txhuam hauv qab no txij.
  • Ntxiv ib co mumbo jumbo sab nraud lub ntsiab template txhais tias enables "formatcurrency" Template mus ua hauj lwm. (Koj yuav qhia tau tias kuv muaj ib cov neeg kov tenuous XSL).

Ua ntej, ze rau saum ItemStyle.xsl, ntxiv cov kab no:

  <!-- Tej mumbo jumbo uas peb tso saib tuaj enables. txiaj. -->
  <xsl:hom zauv lub npe="cov neeg ua haujlwm" ntiv="D" />

  <xsl:Template lub npe="Neej ntawd" phim="*" hom="itemstyle">

Faj seeb txog tias kuv ntxiv tias yuav ua ntej mus ncaj rau <xsl:Template npe = "Default" …> txhais.

Tom ntej, rov qab mus saib peb daim phiaj template. Menyuam mos liab cov daim phiaj template sim cov cai nram qab no. Nws yog muab commented, tab sis tsis txhob yig email rau kuv los sis tawm lus rau kuv blog yog hais tias koj muaj lus nug.

  <xsl:Template lub npe="Daim phiaj" phim="Tshais[@Style = 'Daim phiaj']" hom="itemstyle">

    <!--
      ContentMain.xsl kis tau CurPos thiab xeem.
      Peb siv cov no los conditionally emit rau txoj kev qhib thiab kaw <cov lus> cim npe.
    -->
    <xsl:param lub npe="CurPos" />
    <xsl:param lub npe="Kav" />

    <!-- Cov tsiaj ntawv nram qab no yog los ntawm tus txheem ItemStyle.xsl unmodified -->
    <xsl:kuj sib txawv thiab lub npe="SafeImageUrl">
      <xsl:hu-template lub npe="OuterTemplate.GetSafeStaticUrl">
        <xsl:nrog param lub npe="UrlColumnName" xaiv="'ImageUrl'"/>
      </xsl:hu-template>
    </xsl:kuj sib txawv thiab>
    <xsl:kuj sib txawv thiab lub npe="SafeLinkUrl">
      <xsl:hu-template lub npe="OuterTemplate.GetSafeLink">
        <xsl:nrog param lub npe="UrlColumnName" xaiv="'LinkUrl'"/>
      </xsl:hu-template>
    </xsl:kuj sib txawv thiab>
    <xsl:kuj sib txawv thiab lub npe="DisplayTitle">
      <xsl:hu-template lub npe="OuterTemplate.GetTitle">
        <xsl:nrog param lub npe="Npe" xaiv="@Title"/>
        <xsl:nrog param lub npe="UrlColumnName" xaiv="'LinkUrl'"/>
      </xsl:hu-template>
    </xsl:kuj sib txawv thiab>
    <xsl:kuj sib txawv thiab lub npe="LinkTarget">
      <xsl:Yog hais tias ntsuam xyuas="@OpenInNewWindow = 'Tseeb'" >_blank</xsl:Yog hais tias>
    </xsl:kuj sib txawv thiab>

    <!--
      Ntawm no peb txhais ib kuj sib txawv thiab, "tableStart".  Qhov no muaj cov HTML uas peb siv txhais cov lus qhib cov qhov rooj li no rau cov ntawv qhia kiag.  Nco ntsoov tias CurPos = 1, nws nrog cov HTML rau ib CDATA lossis.
      Txwv tsis pub, nws yuav tau npliag.

      Cov nqi no tableStart no emited txhua zaus ItemStyle hu ua ntawm ContentQueryMain.xsl.
    -->
    <xsl:kuj sib txawv thiab lub npe="tableStart">
      <xsl:Yog hais tias ntsuam xyuas="$CurPos = 1">
        <![CDATA[
        <ciam teb lus = 1>
          <tr bgcolor = "ntsuab">
            <Td><xim Font = "dawb"><b>Qhov project Name</b></Font></Td>
            <Td dlhos = "txoj cai"><xim Font = "dawb"><b>Sau rau hnub tim</b></Font></Td>
            <Td dlhos = "txoj cai"><xim Font = "dawb"><b>Nyiaj txiag</b></Font></Td>
            <Td dlhos = "txoj cai"><xim Font = "dawb"><b>Cov nqi</b></Font></Td>
            <Td><xim Font = "dawb"><b>Zuag qhia tag nrho cov txheej xwm</b></Font></Td>
          </tr>
        ]]>
      </xsl:Yog hais tias>
    </xsl:kuj sib txawv thiab>

    <!--
      Kuj sib txawv thiab lwm, tableEnd cias nyiaj thiab lub sij lub kaw lus lossis.

      Raws li nrog tableStart, Nws yog emited.  Qhov no yog vim li cas nws tus nqi yog raug conditionally based raws li qhov seb peb twb tau mus rau kab kawg ntawm ContentQueryMain.xsl.
    -->
    <xsl:kuj sib txawv thiab lub npe="tableEnd">
      <xsl:Yog hais tias ntsuam xyuas="$CurPos = $Last">
        <![CDATA[ </cov lus> ]]>
      </xsl:Yog hais tias>
    </xsl:kuj sib txawv thiab>

    <!--
      Nco ntsoov emit tus txheem ntawm tableStart.  Yog hais tias qhov no yuav tsis tau rau thawj kab dhau rau peb ntawm ContentQueryMain.xsl, ces peb paub nws tus nqi yuav dawb paug.

      Lov tes taw tso zis ntau escaping vim hais tias thaum twg tableStart nws tsis dawb paug, nws muaj xws li cov HTML uas peb xav tau nws los ntawm qhov browser.  Yog peb tsis txhob hais XSL parser los lov tes taw rau cov zis escaping, nws yuav ua kom muaj khoom xws li"&LT;cov lus&gt;" hloov ntawm"<cov lus>".
    -->
    <xsl:tus nqi-ntawm xaiv="$tableStart" lov tes taw-zis-escaping="yog"/>


    <tr>
      <!--
      P:Project_x005F_x0020_Name P:Project_x005F_x0020_End_x005F_x0020_Date P:Project_x005F_x0020_Budget P:Project_x005F_x0020_Expenses P:Project_x005F_x0020_Status
      -->
      <Td>
        <xsl:tus nqi-ntawm xaiv="@Project_x005F_x0020_Name"/>
      </Td>

      <Td dlhos="txoj cai">
        <xsl:tus nqi-ntawm xaiv="@Project_x005F_x0020_End_x005F_x0020_Date"/>
      </Td>

      <Td dlhos="txoj cai">
        <xsl:hu-template lub npe="formatcurrency">
          <xsl:nrog param lub npe="tus nqi" 
xaiv="@Project_x005F_x0020_Budget"></xsl:nrog param> </xsl:hu-template> </Td> <Td dlhos="txoj cai"> <xsl:hu-template lub npe="formatcurrency"> <xsl:nrog param lub npe="tus nqi" xaiv="@Project_x005F_x0020_Expenses">
</xsl:nrog param> </xsl:hu-template> </Td> <Td> <xsl:tus nqi-ntawm xaiv="@Project_x005F_x0020_Status"/> </Td> <!-- Tag nrho cov nram no yog commented tawm hais yam. Txawm li cas los, coj nws rov qab thiab stuff nws mus ua ib tug <Td> saib cov nyhuv. --> <!-- <div daim id = "linkitem" hoob = "item"> <xsl:Yog tias kuaj = "hlua-ntev($SafeImageUrl) != 0 "> <div hoob = "duab-tsam-laug"> <ib tug href = "{$SafeLinkUrl}" TARGET = "{$LinkTarget}"> <img hoob = "duab-tas-dav" src = "{$SafeImageUrl}"
xwm = "{@ImageUrlAltText}"/> </ib tug> </div> </xsl:Yog hais tias> <chav kawm ntawv div = "txuas yam"> <xsl:hu-template
name="OuterTemplate.CallPresenceStatusIconTemplate"/> <ib tug href = "{$SafeLinkUrl}"
TARGET = "{$LinkTarget}" Title = "{@LinkToolTip}"> <xsl:tus nqi-kev xaiv = "$DisxslyTitle" /> </ib tug> <div hoob = "hauj lwm"> <xsl:tus nqi-cov select="@Description" /> </div> </div> </div>
--> </tr> <!-- Emit kaw table lossis. Yog tias peb tsis nyob rau hnub kab, qhov no yuav ua dawb paug. --> <xsl:tus nqi-ntawm xaiv="$tableEnd" lov tes taw-zis-escaping="yog"/> </xsl:Template> <xsl:Template lub npe="formatcurrency"> <xsl:param lub npe="tus nqi" xaiv="0" /> <xsl:tus nqi-ntawm xaiv='hom ntawv xov tooj($tus nqi, "$DDD,DDD,DDD.HNUB", "ua hauj lwm")' /> </xsl:Template>

22 xav txog"Teeb rooj txheej Query Web site qhov ntsiab hauv ib ib daim phiaj / Lub rooj

  1. Andreas

    Aah… yog vim kuv cov Style sau npe txawv ib tug thiab tsis realise nug tias nyob hauv lub ContentQueryMain.xsl nws saib rau qhov "style":

    <xsl:Thaum test="@Style='NameOfMyStyle'">

    Cov uas renamed nws haujlwm. 🙂

    Teb
  2. Andreas

    Nws yuav luag ua hauj lwm rau kuv: Kuv tswj rau output cov </cov lus> xaus lossis kom raug, tab sis, yog tus lossis starting uas ploj lawm. No mas, qhov kev kuaj ntawd = "$CurPos = 1" tsis rov muaj tseeb. Tab sis vim li cas?

    Teb
  3. Anand singh Rawat

    Yawm ncej. Kuv tau ua tag nrho cov saum no tej Paul. Kuv muaj ib cov lus nug, cas yuav achive kuv qhov tawm ntawm cov "tag nrho cov Expences" los yog tawm ntawm cov nqi ntawm txhua ob.

    Teb
  4. Lisa

    Koj tau ua haujlwm uas tsim cov ntaub kev cai ContentQueryMain thiab cov ItemStyle xsl ntawv? Yog vim li cas kuv hais yog tias kuv tsis xav yuav txhawj txog kuv kev cai yeej overwritten tej thaj ua rau thaj los hloov khoom dua tshiab. Koj tsis muaj piv txwv? Kuv twb sim ua ib daim ntawv zoo tib yam rau ContentQueryMain.xsl thiab uploading ntawd daim ntawv kev cai tshiab rau lub tsev qiv ntawv Style. Thaum muab tus siv rau tej ntaub ntawv no xsl tus .webpart MainXslLink cuab yeej, Kuv tau 401 tsis tso cai. Tej ntaub ntawv rau kev cai xsl yog ib cov published version thiab sawv daws tau nyeem ntawv rau nws.

    Teb
  5. Greg Sheridan

    nyob zoo, qhov no yog ib cov tswv yeej posting. Kuv xav tias txhua yam ua hauj lwm, thiab xim raws kuj Mike av ntawd hloov ces nws pawg
    soj ntsuam sab hauv lub qhov rooj los Xijpeem kuv xaiv raws li cov pab pawg neeg los parameter hauv qhov CQWB zog.
    Kuv muab lub npe ib qhov txuas kuj, yog li ntawd xwb nicely. Kuv tseem muaj ib qho teeb meem, ho. Kuv tabtom grouping soj ntsuam los ntawm qhov chaw lub npe. Hauv lub rooj, nws pawg tau nicely, thiab nws zoo li yawm suab, tiam sis nws tseem printing tawm rau txhua tus neeg
    npe(hauv kuv tsev neeg cov kev kawm ntawv npe) saum toj rooj. Leej twg puas paub tua no?
    Tsaug,
    Greg

    Teb
  6. Tsis muaj lub npe

    Tshooj zoo. Kuv muab kuv cov lus zoo tus cov neej ntawd Sharepoint teev ntawm cais qhov chaws ntawm daim ntawv tswj. Ntawm no yog cov ntsiab HTML blocks ntxiv kom haum nyob rau hauv ItemStyle:

    <ROOJ dav = "100%" hoob = "ms-listviewtable" ciam teb = 0 cellspacing = 0 cellpadding = 1 dir = "None">

    <!–HEADER–>
    <Cov chav kawm TR = "ms-viewheadertr" VALIGN = TOP>
    <TH nowrap tau = "col" hoob = "ms-vh2"><div style = "dav:100%;txoj hauj lwm:tus kwv tij;sab laug:0;saum:0;">
    <ROOJ style = "dav:100%;" CtxNum = "1" qhov siab = "100%" cellspacing = 1 cellpadding = 0 hoob = "ms-unselectedtitle">
    <TR>
    <TD dav = "100%" Hoob = "ms-vb" nowrap>
    Texte du titre ici

    </TD>
    <TD style = "txoj hauj lwm:tsis;">
    </TD>
    </TR>
    </COV LUS></div>
    </TH>

    <!–Rov ua rau tag nrho cov header hlwb–>
    </TR>

    <!– Cov ntaub ntawv los ntawm lub rooj –>
    <Cov chav kawm TR = "">
    <!–Cov ntaub ntawv qhia kiag, siv Paul txoj cai rau ib tug thawj uas tus hyperlink –>
    <TD hoob = "ms-vb2">Cov ntaub ntawv ntawm no</TD>

    <!–Kem npliag–>
    <TD hoob = "ms-vb2">
    <ntsua kev dir = All></ntsua kev><
    /TD>

    <!–Hnub tim sab–>
    <TD hoob = "ms-vb2">
    <NOBR>11/12/2008</NOBR>
    </TD>
    </TR>

    <!–***Lwm leej – Siv kuj sib txawv ib tug tshiab XSL thiab uas yuav ntxig rau lwm hoob kawm raws li qhov tam sim no leej modulo 2–>
    <Cov chav kawm TR = "ms-alternating">

    </TR>
    </COV LUS>

    Teb
  7. Mike xim av
    Zoltan,
    Kuv tau ua hauj lwm rau qhov no ib yam li koj. Kuv xav tag nrho kuv cov khoom dlhau theem teev tseg nyob hauv lub caij grouped es tsis yog ib tug lits. Ntawm no yog li cas kuv tiav nws.
    ContentQueryMain.xsl
    <xsl:Thaum test="@Style='Grid'">
    <xsl:thov templates xaiv = "." hom = "itemstyle">
    <xsl:nrog param name = "CurPos" xaiv = "$CurPosition" />
    <xsl:nrog param name = "kav" xaiv = "$LastRow" />
    <!–ntxiv no nqe tshiab kom dhau hauv lub parameter ntawm ib cov lus tshiab twb pib–>
    <xsl:nrog param name = "StartNewGroup" select="@__begingroup" />
    </xsl:thov templates>
    </xsl:Thauj tw>
    ItemStyle.xsl
    Ntxiv koj parameter
    <xsl:param name = "StartNewGroup" />
    Ntxiv cov ntawv no nrog rau thawj kab ntawm cov ntaub ntawv
    <xsl:xaiv>
    <xsl:Thaum kuaj = "$StartNewGroup = 'Tseeb'">
    <tr>
    <Td >
    <xsl:hu-template name="OuterTemplate.GetGroupName">
    <xsl:nrog param name = "GroupName" select="@*[lub npe()= $Group]"/>
    <xsl:nrog param name = "GroupType" xaiv = "$GroupType" />
    </xsl:hu-template>
    </Td>
    </tr>
    </xsl:Thauj tw>
    <xsl:txwv tsis pub>
    </xsl:txwv tsis pub>
    </xsl:xaiv>
    Qhov no yuav tsum tau ntsuam xyuas koj qhov teeb meem grouping nyob rau hauv koj daim phiaj. Txhua pawg yuav tam sim no pib ntawm txoj kev tshiab uake ntawm cov pab pawg neeg lub npe. Hauv kuv hais haum kuv ua tau ntxiv ib VOJVOOS <Td /> nyob rau hauv cov ntaub ntawv kom thiaj li zoo indent lub grouping sawv zoo npaum li cas.
    Site1
    datacolumn1 datacolumn2 datacolumn3 thiab lwm yam

    datacolumn1 datacolumn2 datacolumn3 thiab lwm yam
    Site2
    datacolumn1 datacolumn2 datacolumn3 thiab lwm yam
    Site3

    datacolumn1 datacolumn2 datacolumn3 thiab lwm yam

    datacolumn1 datacolumn2 datacolumn3 thiab lwm yam
    yam.
    Teb
  8. Zoltan
    Nyob zoo pov,
    Tsaug rau tus ncej, kuv tswj tau organise rau kuv cov lus nug tau rau hauv ib daim phiaj, Nws yog ib qho yuav pab tau heev. Txawm li cas los, Kuv yuav tsum mus ntxiv thiab kuv xav tau raws li qhov chaw cov pab pawg. Thaum lub caij, cov kawm ntawv npe ntawv no muaj ua ntej, thiab ces tus ntawd yog daim ib xwb loj phiaj sib sau ua ke tas nrho cov natwm ntawm chaw sib txawv. Ib yam dab tsi nyiam qhov no:
    Site1 lub npe
    Site2 lub npe
    Cov ntaub ntawv nyob rau hauv daim phiaj rau txhua qhov chaw
    Tej cov tswv yim rau kuv yuav tsum tau hloov li cas thiaj li yuav tau txais kuv cov ntaub ntawv raws li nram no:
    Site1 lub npe
    Cov ntaub ntawv nyob rau hauv daim phiaj rau Site1
    Site2 lub npe
    Cov ntaub ntawv nyob rau hauv daim phiaj rau Site2
    Tsaug ua ntej,
    Zoltan
    Teb
  9. Pierre Joubert
    Ncej zoo heev, solved kuv qhov teeb meem kuv.
    Kuv tus no tsuas yog displaying teb AssignedTo, Kuv configure nws nrog tus neeg "siv" teb yam thiab txawv teb rau webpart ces qhia qhov yuam kev no:
    "Muaj ib qho yuam kev retrieving ntawv mus tso saib nyob rau hauv cov Web site qhov no."
    Kuv twb sim siv teb tau txhua yam, nrog rau txhua yam uas lwm haiv neeg uas "siv" nws, tsis tso saib qhov yuam kev, tab sis nws tsis tso saib dab tsi hauv lub tshav pob. Kom kuv pomzoo piv txwv tias cov neeg teb yam ntawd puas muaj tseeb, ces kuv yuav tsum tau muaj ib qhov qhov chaw.
    Tej cov tswv yim rau qhov no?
    Regards
    Pierre
    Teb
  10. Charftong
    Yawm ncej!!! Heev heev tswv.
    Yog muaj lus nug ceev, koj tau ua haujlwm rau displaying AssignedTo los yog ModifiedBy teb uas kuaj pom? Vim, tav twg kuv sim dipslay raug tuaj hauj lwm rau teb rau hauv cov CQWP, nws ib txwm qhia nrog ua piv txwv "203;#Charf tooj". Kuv nrhiav tsis tau ib txoj kev nyob ib ncig ntawm no.
    Teb
  11. Jennifer Davis
    Paul
    Tshooj yawm suab, Ua tsaug. Kuv tabtom ua ib yam dab tsi zoo heev tab sis xav tso saib ib qhov txuas mus rau ib qhov chaw es cov khoom nyob rau hauv daim ntawv. Piv txwv, wb muaj 25 theem saum toj kawg nkaus qhov project chaw thiab txhua yam muaj ib daim ntawv teev uas muaj cov yam. Cov no yog ib qhov Project Name, Faib, Hauj lwm lawm. Kuv xav kom siv cov qhov Web site ib feem ntawm cov lus nug kom rub tau cov ntaub ntawv no thiab muaj succeeded tsis xam hais tias yuav yog vim qhov URL siv kuv rau cov khoom nkag rau hauv daim ntawv thiab kuv yeej yuav tuaj coj kuv mus rau ib qhov chaw. ua koj muab kuv tej tswv yim?
    Ua tsaug
    Jen
    Teb
  12. Kieran sau tau:

    Kuv tuaj los pov,

    Thaum ua hauj lwm nrog cov qhov Web site xml/xsl thiab cov lus nug lawm, koj yuav nrhiav tau ib co kev zoo los format koj xslt? Tseeb sim hloov thiab ntsuam xyuas txoj tsim yog tiag ib txoj kev mob hauv qhov ib ** nyuam qhuav uas siv ib phau ntawv editor…

    Txhua yam zoo

    Teb
  13. Michael Dipay
    Hais txog qhov no kuv twb muaj dhau lub sij hawm uas nws tsis tso saib cov dluab ntawm lub daim phiaj saib tiam sis txhais qhia hauv cov ntawv nyeem (https://myweb.com/Marketing/images/icn-order.gif,). Kuv tswj tau cog lus nrog rau kev pab los ntawm SharePoint Designer los tsim kev cai saib thiab xaiv cov kev cai txhua uas kuv xav tso saib. Kuv pom tias cov dluab qhia kiag yam muaj qhia ua URL(comma) (e.g. https://myweb.com/Marketing/images/icn-order.gif,). Cov hom ntawv tam sim no yog phau ntawv, Kuv yuav tsum hloov rau daim duab los ntawm cov khaub xsl:pab raws tus nqi-ntawm qib-> Hom ntawv los ua daim duab. Qhov kev hloov no cov zaub kom cov dluab kev cai uas kuv xav pom. Kuv tau theej cov code kom pom cov duab ( <img ciam teb ="0" src = "{substring-ua ntej(@IcnOrder, ‘, ‘)}" /> ) Thiab nyob rau hauv cov ntaub ntawv ItemStyle.xsl kuv xav hloov lub @PICTURECOLUMNNAME mus tus <img ciam teb ="0" src = "{substring-ua ntej(@IcnOrder, ‘, ‘)}" /> . Ces tseg nws. Tam sim no kuv rooj daim phiaj tawm los qhia tias cov ntawv nyeem raws li kev cai tus duab ntaus txhua.
    Teb
  14. Helen
    Kuv tuaj los pov,
    Tsaug rau tsab xov xwm zoo kawg thiab!
    Koj hais cai formatting – "Koj yuav tau muab cai formatting, xws li displaying txug tej yaam uas muaj lawv cov nyiaj txiag hauv liab exceeded." Koj sim mus yuav tau ib tug piv txwv txoj kev uas?
    Tsaug dua!
    Helen
    Teb
  15. Michael Dipay
    Kuv tuaj los pov,
    Nws yog ib tsab xov xwm zoo thiab tau ua kom muaj qhov txheeb xyuas tau ib yam li tau leej twg. Kuv muaj ib tug yuav tsum tau mus pom ib tug duab nyob rau hauv daim phiaj ua ib tug nws txhua. Tab sis nws tsis yog displaying cov duab nyob rau hauv daim phiaj, xwb qhia qhov url rau daim duab nrog ib (,) comma kawg.
    (e.g. https://myweb.com/Marketing/images/icn-order.gif, )
    Kuv yuav tsum tau siv duab los yog daim duab nyob hauv CommonViewFields teb seb? (e.g. InternalColumnName, Duab)
    Tsaug,
    Mike
    Teb
  16. Saji Ijiyemi

    Koj cov ncej yog raws nraim li kuv twb nrhiav. Txawm li cas los, Kuv tsis tau mus ua hauj lwm.

    Kuv muaj cov ntaub ntawv uas muab cia rau hauv ntau doc. qiv tab sis dej num uas siv ib tug kev cai kawm sab (xaiv: 1 los sis 2. Kuv xav siv CQWP los qhia cov ntawv nyob rau cov hoob kawm.
    Kuv twb tau mus ntxiv rau lub CQWP, export mus SPD, configure lub itemStyle.xls qhia kev cai fileds nyob rau hauv daim ntawv teev saib. Txawm li cas los, Kuv yuav tsis ntse kev li koj piav nov.

    Cov no yog txhua qhov kuv xav kom koj qhia rau kuv CQWP:

    Cov hom ntaub ntawv (qhia icon)
    Cov ntaub ntawv npe
    Hnub kawg hloov
    Hloov los ntawm leej twg
    Xyuas kom
    Tshawb xyuas hauv Comments

    Kuv muaj cov nyob rau hauv ib daim ntawv teev hom. Cas kuv yuav hloov nws mus rau ib lub hom talble.

    Tsaug.

    Saji

    Teb

sau ntawv cia

Koj email chaw nyob yuav tsis muab luam tawm. Search cim *