How to configure a custom project frontpage - Puzzlepart/prosjektportalen GitHub Wiki

Introduction

In order to configure a custom project frontpage, you need to create an extension file. You can use any editor you want as long the file extension is .txt.

Creating the extension file

Open Notepad or similiar. We now need to write some JSON.

You can use this as starting point:

This will remove the existing webparts on the project frontpage and add the following:

  1. Prosjektets faser
  2. Om prosjektet
  3. Usikkerhet-list view web part
{
    "Files": [
        {
            "Folder": "SitePages",
            "Src": "{sitecollection}/Resources/SitePage.txt",
            "Url": "ProjectHome.aspx",
            "Overwrite": true,
            "RemoveExistingWebParts": true,
            "WebParts": [
                {
                    "Title": "Prosjektets faser",
                    "Zone": "LeftColumn",
                    "Order": 10,
                    "Contents": {
                        "FileSrc": "{wpgallery}/ProjectPhases.webpart"
                    }
                },
                {
                    "Title": "Om prosjektet",
                    "Zone": "RightColumn",
                    "Order": 10,
                    "Contents": {
                        "FileSrc": "{wpgallery}/ProjectInfo.webpart"
                    }
                },
                {
                    "Title": "Usikkerhet",
                    "Zone": "LeftColumn",
                    "Order": 2,
                    "PropertyOverrides": [{
                            "name": "Title",
                            "type": "string",
                            "value": "Usikkerhet"
                        },
                        {
                            "name": "ListUrl",
                            "type": "string",
                            "value": "{site}/Lists/Usikkerhet"
                        },
                        {
                            "name": "TitleUrl",
                            "type": "string",
                            "value": "{site}/Lists/Usikkerhet"
                        }
                    ],
                    "Contents": {
                        "FileSrc": "{sitecollection}/Resources/ListViewWebPart.txt"
                    },
                    "ListView": {
                        "List": "Usikkerhet",
                        "View": {
                            "Title": "",
                            "ViewFields": [
                                "LinkTitle",
                                "GtRiskFactor",
                                "GtRiskFactorPostAction",
                                "GtRiskStatus"
                            ],
                            "AdditionalSettings": {
                                "RowLimit": 10,
                                "Paged": true,
                                "ViewQuery": "<OrderBy><FieldRef Name='GtRiskFactor' Ascending='FALSE' /></OrderBy>"
                            }
                        }
                    }
                }
            ]
        }
    ]
}

Important to note here is:

  1. Folder

Folder to add the new file to. We're creating a new project frontpage, so we'll use SitePages.

  1. Src

Source file to use. We're using {sitecollection}/Resources/SitePage.txt which comes with the standard installation.

  1. Url

Url of the new file. We're using ProjectHome.aspx since we're overriding the existing project frontpage.

  1. Overwrite

Set to true since we're overriding a file (project frontpage).

  1. RemoveExistingWebParts

We want to remove the existing webparts, and add our own. So set to true.

  1. WebParts

Our webparts. Important to note here is Title, Zone, Order and Contents.

Title here doesn't do anything about the ChromeTitle. That's set in the webpart XML file that we're pointing to.

Zone is where to place the webpart. The source file we're using ({sitecollection}/Resources/SitePage.txt) gives us LeftColumn and RightColumn.

Order is the order of the webpart in its zone.

Contents is the XML content of the webpart. We're using FileSrc and pointing it to {wpgallery}/ProjectInfo.webpart.

NOTES:

  1. Token wpgallery can be used for web part gallery.

When you're done adding your desired links, save the file with extension .txt.

Upload the extension file

Find the library

  1. Go to Site Settings
  2. Under Look and Feel / Utseende og funksjonalitet you'll find Project Portal - Extensions / Prosjektportalen - Utvidelser
  3. This link will take you to the extension library where you can upload your extension file

Configure the extension item

After upload your .txt file, it's time to look at the extension item.

Open the edit form of the extension file.

How-to-configure-a-custom-project-frontpage-01.PNG

The edit form should look something like this:

How-to-configure-a-custom-project-frontpage-02.PNG

  1. Rekkefølge

Order of execution. Important in some advanced cases where you have multiple extensions dependent on each other.

  1. Aktivert

Is the extension activated, meaning should it be executed when creating new projects.

  1. Vis i skjema

Should the extension be visible and selectable in the new project form.

How-to-configure-a-custom-project-frontpage-03.PNG

  1. Navn

Filename (not important)

  1. Tittel

Add a descriptive title

  1. Kommentarer

Add comments (optional)

⚠️ **GitHub.com Fallback** ⚠️