How to configure lists and libraries - Puzzlepart/prosjektportalen GitHub Wiki

Introduction

In order to configure lists and libraries, 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.

TIP: You can use http://jsoneditoronline.org/

You can use this as starting point:

This will create a new list 'Prosjektoppgaver', add a custom content type and configure the default view of that list. You can also use this method to override default lists and libraries created in the default project (by Prosjektportalen).

{
    "Lists": [{
        "Title": "Prosjektoppgaver",
        "Description": "",
        "Template": 171,
        "ContentTypesEnabled": true,
        "RemoveExistingContentTypes": true,
        "ContentTypeBindings": [{
            "ContentTypeID": "0x010800233B015F95174C9A8EB505493841DE8D"
        }],
        "AdditionalSettings": {
            "EnableVersioning": true
        },
        "Views": [{
            "Title": "Alle oppgaver",
            "ViewFields": ["Checkmark", "LinkTitle", "StartDate", "DueDate", "AssignedTo", "GtProjectPhase", "Modified", "Editor"],
            "AdditionalSettings": {
                "RowLimit": 30,
                "Paged": true,
                "ViewQuery": ""
            }
        }]
    }]
}

Important to note here is:

  1. Title

Title is the title of the list. The URL will be automatically set according to the title

  1. Template

The ID of the list type. An overview of list template ID's can be found here https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splisttemplatetype.aspx

  1. ContentTypeBindings

This is where you can bind custom content types to the list.

  1. Views

You can configure several views for the list. Remember to use the internal field names for viewfields.

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

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

  1. Aktivert / Active

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

  1. Vis i skjema / Show in form

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)