Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Set-PnPPage translation a full width section page #1554

Open
TycoMoon opened this issue Oct 11, 2024 · 3 comments
Open

[BUG] Set-PnPPage translation a full width section page #1554

TycoMoon opened this issue Oct 11, 2024 · 3 comments
Labels
area: pages API 📄 Working with modern pages question Further information is requested

Comments

@TycoMoon
Copy link

Issue Reference

I am experiencing an issue related to the function Set-PnPPage for translation with a full width section page. For more details, please refer to my existing issue:

Code Reference

The specific part of the code that seems to have the issue is located here:

@jansenbe
Copy link
Contributor

@TycoMoon : can you verify the properties of the image web part on the source page you're translating from? You can pull the page json from the CanvasContent1 field of the page in the sitepages library.

@jansenbe jansenbe added question Further information is requested area: pages API 📄 Working with modern pages labels Oct 14, 2024
@TycoMoon
Copy link
Author

@jansenbe : I retrieve data with

(Get-PnPListItem -List "Site Pages" -Id 55).FieldValues['CanvasContent1']

Here’s what I get from the "data-sp-webpartdata" of my full-width image web part:

{
    "id": "d1d91016-032f-456d-98a4-721247c305e8",
    "instanceId": "668bbfe5-5da4-4290-9fa2-4ff8e9737429",
    "title": "Image",
    "description": "Ajouter une image, une image ou une photo à votre page, y compris des superpositions de texte et la possibilité de rogner et de redimensionner des images.",
    "audiences": [],
    "serverProcessedContent": {
        "htmlStrings": {},
        "searchablePlainTexts": {},
        "imageSources": {
            "imageSource": "https://cdn.hubblecontent.osi.office.net/m365content/publish/006d27b5-ce41-4f23-b65e-df986bb9947b/648617500.jpg"
        },
        "links": {},
        "customMetadata": {
            "imageSource": {
                "width": 6016,
                "height": 4016
            }
        }
    },
    "dataVersion": "1.12",
    "properties": {
        "imageSourceType": 2,
        "captionText": "",
        "altText": "",
        "linkUrl": "",
        "overlayText": "",
        "fileName": "Personne-dans-une-rue-encombrée.jpg",
        "imgWidth": 6016,
        "imgHeight": 4016,
        "overlayTextStyles": {
            "textColor": "light",
            "isBold": false,
            "isItalic": false,
            "textBoxColor": "dark",
            "textBoxOpacity": 0.54,
            "overlayColor": "light",
            "overlayTransparency": 0
        },
        "minimumLayoutWidth": 1,
        "isOverlayTextVisible": true,
        "alignment": "Center",
        "advancedImageEditorData": {
            "isAdvancedEdited": false
        },
        "fixAspectRatio": false
    },
    "containsDynamicDataSource": false
}

and from data-sp-controldata

{
    "position": {
        "layoutIndex": 1,
        "zoneIndex": 3,
        "sectionIndex": 1,
        "controlIndex": 1,
        "sectionFactor": 0,
        "zoneId": "301c78f9-f7c8-47f2-82ac-40bd8a84b91b"
    },
    "controlType": 3,
    "id": "668bbfe5-5da4-4290-9fa2-4ff8e9737429",
    "webPartId": "d1d91016-032f-456d-98a4-721247c305e8",
    "reservedHeight": 899,
    "reservedWidth": 1346,
    "addedFromPersistedData": true
}

Hope it help 😄

@TycoMoon
Copy link
Author

Same error in a different context:

     $null = set-PnPPage -Identity $NamePage -Publish
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot host text controls inside a one column full width section, only an image web part or hero web part are allowed

In this case, it is the default TopicHome.aspx page from the Default Template, which uses the full-width hero web part when creating a site, causing this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: pages API 📄 Working with modern pages question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants