Tutorials

Add a News Content View on Workspaces

Updated: March 18, 2024

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:isVersion = 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.