Tutorials

Add a News Content View on Workspaces

Updated: February 9, 2017 Page Information Edit on GitHub

This page is scheduled for review and update. Check back soon for updated content!

In the section, we will:

  • prepare a new tab for workspaces,
  • override the default Workspace document type to customize it with the newly created tab.

For this section, it is recommended to take a look at the how-tos for a step-by-step approach:

Create a New Content View for Workspaces

  1. Create a new content view called NewsTab.
  2. Give it the following query filter: ecm:isCheckedInVersion = 0 AND ecm:currentLifeCycleState = 'approved' AND ecm:primaryType = 'News' AND ecm:path STARTSWITH ? and add the query parameter: #{currentDocument.path}
  3. In the Results tab, configure a table with 1 column and 2 two rows. First row is for the title (dc:title, with a text widget), second row is for the content (news:body, with an HTML widget).

    Style your widget

    Don't hesitate to give CSS attributes to the text widget to customize its look. Here is an example of values you can type in the Style text box: color:#4e9ae1;text-decoration:underline;font-weight:bolder;font-size:large;margin:15px 15px 15px 15px

The view is done. Now we need to apply it to the Workspace document type. To do this, we need to override the default Workspace document type.

Override The "Workspace" Document Type

  1. Create a new document type:
    • featureID: Workspace
    • Extends: Folder
  2. In the Definition tab:
    • Accepted Children Type: select Folder, Workspace, Note, File and OrderedFolder.
    • Show Create Child Action: checked.
  3. In Tabs > Content Views tab: add a new tab configuration called News that uses the NewsTab content view and has order 1.
  4. Edit the layouts to remove the default Studio warning.

 

6 months ago Solen Guitter NXDOC-1087: Use new previous/next navigation
8 months ago Andrew Goodricke Add content-review-lts2016 to labels
9 months ago Kevin Leturc NXP-19481: Update MarkLogic page to detail how to configure range element indexes
2 years ago Manon Lumeau 10
2 years ago Manon Lumeau 9
2 years ago Manon Lumeau 8
2 years ago Manon Lumeau 7
3 years ago Alain Escaffre 6
7 years ago Solen Guitter 4 | added tip on widget style
7 years ago Solen Guitter 5
7 years ago Solen Guitter 3
7 years ago Solen Guitter 2
7 years ago Solen Guitter 1
History: Created by Solen Guitter