Question

J'ai une liste d'annonces et au lieu d'afficher toutes les annonces en même temps, il peut y avoir un assez grand nombre, je veux faire défiler un par un.

En dehors de SharePoint, il y a assez peu de méthodes j'utiliser pour y parvenir. J'utiliser jQuery si possible. Je l'ai utilisé jQuery sur le site, mais je voudrais utiliser un carrousel et pour cela la liste des annonces ne peux pas être dans un tableau.

, je dois donc l'une des 3 choses.

a) être en mesure de transmettre les données, peut-être à une partie Web Content Editor, via XSL? Cela permettra d'éliminer la structure de la table et le remplacer par une liste non ordonnée. Je ne suis pas chaud xsl et aurait besoin d'un coup de pouce dans la bonne direction quant à la façon d'y parvenir.

b) Trouver une solution de jQuery qui peut fonctionner avec la structure de la table de la liste des annonces.

c) Une autre solution que je ne l'ai pas pensé.

Les gars idées?

EDIT:. Je l'ai essayé de descendre la route avec un formulaire XSL de données WebPart

J'ai utilisé une autre DFWP pour un modèle et a changé ce que je pense que je devais changer. Est-ce que ce regard de toute façon à ce que je besoin? (Note Je reçois l'erreur suivante:)

Impossible d'afficher ce WebPart. À résoudre le problème, ouvrez cette page Web dans Windows SharePoint Services compatibles éditeur HTML tel Microsoft Office SharePoint Designer. Si le problème persiste, contactez l'administrateur du serveur Web.

code

<WebPartPages:DataFormWebPart runat="server" SuppressWebPartChrome="False" Description="" PartImageSmall="" DataSourceID="" MissingAssembly="Cannot import 

this Web Part." FrameType="TitleBarOnly" ConnectionID="00000000-0000-0000-0000-000000000000" DetailLink="" ExportControlledProperties="True" IsVisible="True" 

AllowRemove="True" AllowEdit="True" ID="g_999db424_8180_48da_a7c7_7457a07205f9" Dir="Default" FrameState="Normal" ViewContentTypeId="" AllowConnect="True" 

PageSize="-1" AllowMinimize="True" IsIncludedFilter="" ShowWithSampleData="False" ChromeType="TitleOnly" HelpMode="Modeless" ExportMode="All" ViewFlag="0" 

Title="Courses I am attending" HelpLink="" AllowHide="True" AllowZoneChange="True" PartOrder="1" UseSQLDataSourcePaging="True" PartImageLarge="" 

IsIncluded="True" NoDefaultStyle="TRUE" __MarkupType="vsattributemarkup" __WebPartId="{999DB424-8180-48DA-A7C7-7457A07205F9}" __AllowXSLTEditing="true" 

WebPart="true" Height="" Width=""><DataSources>
<SharePoint:AggregateDataSource runat="server" IsSynchronous="" SeparateRoot="true" RootName="" RowsName="" 

ID="Announcements"><Sources><SharePoint:SPDataSource runat="server" DataSourceMode="List" SelectCommand="&lt;View&gt;&lt;/View&gt;" UpdateCommand="" 

InsertCommand="" DeleteCommand="" UseInternalName="True"><SelectParameters>
<asp:Parameter DefaultValue="{A6930BA9-B6E2-4D1D-A3FE-5379CE9F01E5}" Name="ListID"></asp:Parameter>
                </SelectParameters>
<UpdateParameters>
<asp:Parameter DefaultValue="{A6930BA9-B6E2-4D1D-A3FE-5379CE9F01E5}" Name="ListID"></asp:Parameter>
                </UpdateParameters>
<InsertParameters>
<asp:Parameter DefaultValue="{A6930BA9-B6E2-4D1D-A3FE-5379CE9F01E5}" Name="ListID"></asp:Parameter>
                </InsertParameters>
<DeleteParameters>
<asp:Parameter DefaultValue="{A6930BA9-B6E2-4D1D-A3FE-5379CE9F01E5}" Name="ListID"></asp:Parameter>
                </DeleteParameters>
</SharePoint:SPDataSource><SharePoint:SPDataSource runat="server" DataSourceMode="List" SelectCommand="&lt;View&gt;&lt;/View&gt;" UpdateCommand="" 

InsertCommand="" DeleteCommand="" UseInternalName="True"><SelectParameters>
<asp:Parameter DefaultValue="{DEEE6EF9-4CCF-408B-A90F-89AD21FB0FD1}" Name="ListID"></asp:Parameter>
                </SelectParameters>
<UpdateParameters>
<asp:Parameter DefaultValue="{DEEE6EF9-4CCF-408B-A90F-89AD21FB0FD1}" Name="ListID"></asp:Parameter>
                </UpdateParameters>
<InsertParameters>
<asp:Parameter DefaultValue="{DEEE6EF9-4CCF-408B-A90F-89AD21FB0FD1}" Name="ListID"></asp:Parameter>
                </InsertParameters>
<DeleteParameters>
<asp:Parameter DefaultValue="{DEEE6EF9-4CCF-408B-A90F-89AD21FB0FD1}" Name="ListID"></asp:Parameter>
                </DeleteParameters>
</SharePoint:SPDataSource>
</Sources><Aggregate><concat name="data source"><datasource name="Announcements" id="0" Type="SPList"/></concat></Aggregate>
</SharePoint:AggregateDataSource>
</DataSources>
<ParameterBindings>
                <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
                <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
                <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
                <ParameterBinding Name="dvt_adhocmode" Location="Postback;Connection"/>
                <ParameterBinding Name="dvt_fieldsort" Location="Postback;Connection"/>
                <ParameterBinding Name="dvt_filterfield" Location="Postback;Connection"/>
                <ParameterBinding Name="dvt_sortdir" Location="Postback;Connection"/>
                <ParameterBinding Name="dvt_sortfield" Location="Postback;Connection"/>
                <ParameterBinding Name="dvt_sorttype" Location="Postback;Connection"/>
                <ParameterBinding Name="dvt_filterfields" Location="Postback;Connection"/>
                <ParameterBinding Name="dvt_partguid" Location="Postback;Connection"/>
            </ParameterBindings>
<DataFields>

</DataFields>
<Xsl>

<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" 

version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" 

xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" 

xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" 

xmlns:ddwrt2="urn:frontpage:internal">
    <xsl:output method="html" indent="no"/>
    <xsl:param name="dvt_adhocmode">sort</xsl:param>
    <xsl:decimal-format NaN=""/>

    <xsl:param name="dvt_apos">'</xsl:param>
    <xsl:param name="UserID" />
    <xsl:param name="dvt_fieldsort" />
    <xsl:param name="dvt_filterfield" />
    <xsl:param name="dvt_sortdir">ascending</xsl:param>
    <xsl:param name="dvt_sortfield" />
    <xsl:param name="dvt_sorttype">text</xsl:param>
    <xsl:param name="dvt_filterfields" />
    <xsl:param name="dvt_partguid" />
    <xsl:variable name="dvt_1_automode">0</xsl:variable>

    <xsl:template match="/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:x="http://www.w3.org/2001/XMLSchema" 

xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" 

xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
        <xsl:call-template name="dvt_1"/>
    </xsl:template>

    <xsl:template name="dvt_1">
        <xsl:variable name="dvt_StyleName">Table</xsl:variable>
        <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" />
        <xsl:variable name="dvt_RowCount" select="count($Rows)" />
        <xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0" />
        <xsl:choose>
            <xsl:when test="$dvt_IsEmpty">
                <xsl:call-template name="dvt_1.empty" />
            </xsl:when>
            <xsl:otherwise><ul id="announcementList" border="0" width="100%" cellpadding="2" cellspacing="0">
                <li>
                <xsl:call-template name="dvt.headerfield" ddwrt:atomic="1" 

xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
                    <xsl:with-param name="fieldname">@Title</xsl:with-param>
                    <xsl:with-param name="fieldtitle">Title</xsl:with-param>
                    <xsl:with-param name="displayname">Title</xsl:with-param>
                    <xsl:with-param name="sortable">1</xsl:with-param>
                    <xsl:with-param name="fieldtype">x:string</xsl:with-param>
                </xsl:call-template>
                </li>
                <li>
                <xsl:call-template name="dvt.headerfield" ddwrt:atomic="1" 

xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
                    <xsl:with-param name="fieldname">@Created</xsl:with-param>
                    <xsl:with-param name="fieldtitle">Created By</xsl:with-param>
                    <xsl:with-param name="displayname">Created By</xsl:with-param>
                    <xsl:with-param name="sortable">1</xsl:with-param>
                    <xsl:with-param name="fieldtype">x:string</xsl:with-param>
                </xsl:call-template>
                </li>
                <li>
                <xsl:call-template name="dvt.headerfield" ddwrt:atomic="1" 

xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
                    <xsl:with-param name="fieldname">@Body</xsl:with-param>
                    <xsl:with-param name="fieldtitle">Body</xsl:with-param>
                    <xsl:with-param name="displayname">Body</xsl:with-param>
                    <xsl:with-param name="sortable">1</xsl:with-param>
                    <xsl:with-param name="fieldtype">x:string</xsl:with-param>
                </xsl:call-template>
                </li>
            </tr>
            <xsl:call-template name="dvt_1.body">
                <xsl:with-param name="Rows" select="$Rows"/>
            </xsl:call-template>
        </ul></xsl:otherwise>
        </xsl:choose>

    </xsl:template>


</xsl:stylesheet>   </Xsl>
</WebPartPages:DataFormWebPart>
Était-ce utile?

La solution 2

Ok je recours à une solution jQuery que je peux obtenir ma tête autour d'elle plus facile que tout SharePoint jette sur moi!

Comme toutes les listes ont la ms-summarycustombody de classe I a pu obtenir ce qui suit pour convertir le table à ul

var div = $("<div id='viewport' class='viewport'></div>");
var list = $("<ul id='announcementList'></ul>");
var listitem = null;
var p = null;
$('.ms-summarycustombody').each(function(i) {
    $(this).find("tr").each(function(i) {
        if (i % 3 == 0) {
            listitem = $("<li/>");
            list.append(listitem);
        }
        p = $("<p/>");
        $(this).find("td").each(function(i) {
            p.append("<span>" + $(this).html() + "</span>");
             });
                 listitem.append(p);
     });
     div.append(list);
     $(this).replaceWith(div);
});

Ensuite, en utilisant jCarouselLite j'ai pu faire défiler les éléments.

$('.viewport').jCarouselLite({
    auto:5000,
    speed:1000
});

Autres conseils

Je vous suggère de vérifier SPServices. Il est une « bibliothèque jQuery qui Abstracts Services Web SharePoint et les rend plus facile à utiliser. »

http://spservices.codeplex.com/

Une autre option à considérer est quelque chose de construire en utilisant l'objet client modèle et JavaScript ... Oops, pas vous utilisez SP2007.

Si ma lecture de votre question est correcte, vous avez déjà un carrousel JavaScript qui nécessite une liste non ordonnée à travailler avec. Donc, je voudrais utiliser la CQWP et XSLT pour formater la liste comme. Je ne pense pas que le XSLT devrait être trop difficile. Vous pouvez commencer par regarder certains XSLT par défaut. Mon conseil est d'utiliser une « identité » XSLT transformez afin que vous puissiez voir le XML d'entrée que vous transformez plutôt que d'essayer de deviner en regardant le XSLT par défaut.

identité XSLT Exemple transform:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

Je ne sais pas si ça aide, mais je l'ai écrit une solution qui fait cela en utilisant le CQWP. Je l'appelle le requête de contenu Web Ticker Partie:

http://www.novolocus.com/software/content -query-ticker-web-partie /

pourrait être d'intérêt.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top