Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG] Resources Web Part is not handled by Get-PnPSiteTemplate

Aperta
#5,375 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
csharp, powershell
Ambito
backend, cli

Direzione di ricerca

Inizia dall’esportazione di Get-PnPSiteTemplate e dalla gestione corrispondente dell’importazione del template, quindi traccia il modo in cui Resources Web Part è rappresentato nei dati di CanvasControl. Esamina l’elenco ConnectionsConfiguration-4ce1892f-76d2-4393-b9df-079a66a95c4a e la relativa colonna Spotlight_x0020_Configuration. Il lavoro è completato quando un sito che contiene questo componente Web esporta i collegamenti necessari e può ricreare un componente Web funzionante dal template.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

If a site has a Resources Web Part on a page, it isn't exported in such a way as it can be reinstantiated with the template. I'm not sure if this makes sense to fix or if the architecture sort of prevents it. In any case...

When we export the site with Get-PnPSiteTemplate, the Resources Web Part ends up looking like this:

<pnp:CanvasControl WebPartType="Custom"
    JsonControlData="{&quot;webPartId&quot;:&quot;fde8ea95-fcbd-4967-abb5-a388e8e2ddfa&quot;,&quot;rteInstanceId&quot;:null,&quot;addedFromPersistedData&quot;:true,&quot;reservedHeight&quot;:218,&quot;reservedWidth&quot;:1204,&quot;controlType&quot;:3,&quot;id&quot;:&quot;2e94fed0-8018-450c-ac2f-4398f843d468&quot;,&quot;position&quot;:{&quot;controlIndex&quot;:5,&quot;zoneIndex&quot;:4,&quot;sectionIndex&quot;:1,&quot;sectionFactor&quot;:100,&quot;layoutIndex&quot;:1,&quot;zoneId&quot;:&quot;505d8621-8e3b-421b-8d0a-c4077e1d72cf&quot;},&quot;emphasis&quot;:{&quot;zoneEmphasis&quot;:0},&quot;flexibleLayoutPosition&quot;:{&quot;lg&quot;:{&quot;x&quot;:0,&quot;y&quot;:8,&quot;w&quot;:70,&quot;h&quot;:13}},&quot;properties&quot;:{&quot;items&quot;:[],&quot;isMigrated&quot;:true,&quot;layoutId&quot;:&quot;Stack&quot;,&quot;shouldShowThumbnail&quot;:true,&quot;isTitleEnabled&quot;:true,&quot;isAudienceTargetingEnabled&quot;:true,&quot;hideWebPartWhenEmpty&quot;:true,&quot;listLayoutOptions&quot;:{&quot;showDescription&quot;:false,&quot;showIcon&quot;:true},&quot;showCardMotion&quot;:true,&quot;dataProviderId&quot;:&quot;Resources&quot;,&quot;webId&quot;:&quot;{siteid}&quot;,&quot;siteId&quot;:&quot;{sitecollectionid}&quot;,&quot;thumbnail_type&quot;:1,&quot;imagePicker&quot;:&quot;https://{fqdn}{site}/SiteAssets/SitePages/Home/[email protected]&quot;,&quot;Title&quot;:&quot;ECS Report&quot;,&quot;titleHTML&quot;:&quot;&lt;h2 class=\&quot;headingSpacingAbove headingSpacingBelow lineHeight1_4\&quot;&gt;&lt;span class=\&quot;fontSizeXLarge\&quot;&gt;Resources&lt;/span&gt;&lt;/h2&gt;&quot;,&quot;pane_link_button&quot;:0},&quot;serverProcessedContent&quot;:{&quot;htmlStrings&quot;:{},&quot;searchablePlainTexts&quot;:{&quot;title&quot;:&quot;Resources&quot;},&quot;imageSources&quot;:{},&quot;links&quot;:{&quot;baseUrl&quot;:&quot;https://{fqdn}{site}&quot;},&quot;componentDependencies&quot;:{&quot;layoutComponentId&quot;:&quot;706e33c8-af37-4e7b-9d22-6e5694d92a6f&quot;}},&quot;dynamicDataPaths&quot;:{},&quot;dynamicDataValues&quot;:{},&quot;dataVersion&quot;:&quot;1.0&quot;}"
    ControlId="fde8ea95-fcbd-4967-abb5-a388e8e2ddfa" Order="5" Column="1" />

This doesn't contain the information required to recreate it and have it be healthy. But it's complicated.

After some spelunking, I found where the Resources links are stored. They are in a hidden list called "ConnectionsConfiguration-4ce1892f-76d2-4393-b9df-079a66a95c4a". That list has one item in it called "VC Configuration". That item has a column called Spotlight_x0020_Configuration which holds the links.

Here's an example payload:

{
    "SpotlightConfiguration": null,
    "CompanyLinks": [
        {
            "Title": "Employee Handbook",
            "Url": "https://aka.ms/ngia-samples",
            "Icon": "https://spex003.sharepoint.com/sites/Solbound/SiteAssets/SitePages/Home/[email protected]",
            "Id": 1,
            "Audiences": [],
            "ThumbnailOption": "Custom"
        },
        {
            "Title": "Org Chart",
            "Url": "https://aka.ms/ngia-samples",
            "Icon": "https://spex003.sharepoint.com/sites/Solbound/SiteAssets/SitePages/Home/[email protected]",
            "Id": 2,
            "Audiences": [],
            "ThumbnailOption": "Custom"
        },
        {
            "Title": "Brand Assets",
            "Url": "https://aka.ms/ngia-samples",
            "Icon": "https://spex003.sharepoint.com/sites/Solbound/SiteAssets/SitePages/Home/[email protected]",
            "Id": 3,
            "Audiences": [],
            "ThumbnailOption": "Custom"
        },
        {
            "Title": "Internal Jobs",
            "Url": "https://aka.ms/ngia-samples",
            "Icon": "https://spex003.sharepoint.com/sites/Solbound/SiteAssets/SitePages/Home/[email protected]",
            "Id": 4,
            "Audiences": [],
            "ThumbnailOption": "Custom"
        },
        {
            "Title": "Benefits & Insurance",
            "Url": "https://aka.ms/ngia-samples",
            "Icon": "https://spex003.sharepoint.com/sites/Solbound/SiteAssets/SitePages/Home/[email protected]",
            "Id": 5,
            "Audiences": [],
            "ThumbnailOption": "Custom"
        },
        {
            "Title": "Pay Stubs & Payroll",
            "Url": "https://aka.ms/ngia-samples",
            "Icon": "https://spex003.sharepoint.com/sites/Solbound/SiteAssets/SitePages/Home/[email protected]",
            "Id": 6,
            "Audiences": [],
            "ThumbnailOption": "Custom"
        },
        {
            "Title": "Training Library",
            "Url": "https://aka.ms/ngia-samples",
            "Icon": "https://spex003.sharepoint.com/sites/Solbound/SiteAssets/SitePages/Home/[email protected]",
            "Id": 7,
            "Audiences": [],
            "ThumbnailOption": "Custom"
        },
        {
            "Title": "ECS Report",
            "Url": "https://aka.ms/ngia-samples",
            "Icon": "https://spex003.sharepoint.com/sites/Solbound/SiteAssets/SitePages/Home/[email protected]",
            "Id": 8,
            "Audiences": [],
            "ThumbnailOption": "Custom"
        }
    ],
    "TitleRegion": null
}
Lingua principale
C#
Stelle
905
Fork
409
Merge medio
2g 9h
PR unite (30g)
10

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pnp/powershell

Tutte le issue di pnp/powershell

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.