How to configure a custom project frontpage - Puzzlepart/prosjektportalen GitHub Wiki
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
.
Open Notepad
or similiar. We now need to write some JSON.
TIP: You can use http://jsoneditoronline.org/
You can use this as starting point:
This will remove the existing webparts on the project frontpage and add the following:
- Prosjektets faser
- Om prosjektet
- 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:
- Folder
Folder to add the new file to. We're creating a new project frontpage, so we'll use SitePages
.
- Src
Source file to use. We're using {sitecollection}/Resources/SitePage.txt
which comes with the standard installation.
- Url
Url of the new file. We're using ProjectHome.aspx
since we're overriding the existing project frontpage.
- Overwrite
Set to true since we're overriding a file (project frontpage).
- RemoveExistingWebParts
We want to remove the existing webparts, and add our own. So set to true
.
- 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:
- Token
wpgallery
can be used for web part gallery.
When you're done adding your desired links, save the file with extension .txt
.
- Go to Site Settings
- Under
Look and Feel
/Utseende og funksjonalitet
you'll findProject Portal - Extensions
/Prosjektportalen - Utvidelser
- This link will take you to the extension library where you can upload your extension file
After upload your .txt
file, it's time to look at the extension item.
Open the edit form of the extension file.
The edit form should look something like this:
- Rekkefølge
Order of execution. Important in some advanced cases where you have multiple extensions dependent on each other.
- Aktivert
Is the extension activated, meaning should it be executed when creating new projects.
- Vis i skjema
Should the extension be visible and selectable in the new project form.
- Navn
Filename (not important)
- Tittel
Add a descriptive title
- Kommentarer
Add comments (optional)