This solution shows configuring a filter in the field “Dynamic View” based on a tagbox. The field dynamic view will show related content based on an assigned tag e.g. tag = project X, related content = all content that also is tagged with project X.

This solution shows how to show related projects. Without any project assigned don’t show the dynamic view field (if no related projects are possible, as no project is tagged).

Instructions

  1. You add the Dynamic View field

  2. You want to have two filters

    1. Show related projects

      {
      	"kind": "TermFilter",
      	"field": "projects.newProject._refId",
      	"term": "{{data.projects.newProject[0]._refId}}"
      }
      CODE
    2. Show nothing if there is no value in the tagbox for projects

      {
      	"kind": "ExistsFilter",
      	"field": "projects.newProject._refId"
      }
      CODE
  3. For the dynamic view - both filters must be true hence you need an AND filter

    {
      "kind": "AndFilter",
      "filters": [
    	{
    		"kind": "ExistsFilter",
    		"field": "projects.newProject._refId"
    	},
    	{
    		"kind": "TermFilter",
    		"field": "projects.newProject._refId",
    		"term": "{{data.projects.newProject._refId}}"
    	}
      ]
    }
    JSON
    1. This filter will show all related projects, and at least one project must exist on the Content Item.

  4. For multi tagboxes, you must include the Nested Filter

    {
    	"kind": "NestedFilter",
    	"path": "projects.newProject",
    	"filter": {
    		"kind": "AndFilter",
    		"filters": [
    			{
    				"kind": "ExistsFilter",
    				"field": "projects.newProject._refId"
    			},
    			{
    				"kind": "TermFilter",
    				"field": "projects.newProject._refId",
    				"term": "{{data.projects.newProject[0]._refId}}"
    			}
    		]
    	}
    } 
    CODE
    1. For multi tagbox, you must include an index value for the term in the term filter e.g.
      aa) match the 1st tag: "term": "{{data.projects.newProject[0]._refId}}"
      ab) match the 2nd tag: "term": "{{data.projects.newProject[1]._refId}}"
      ac) match 1st and 2nd tag: change to TermsFilter and
      "terms": ["{{data.projects.newProject[0]._refId}}", "{{data.projects.newProject[1]._refId}}"]

This filter will always include the original content item (the base). If you want to remove the original, you exclude the id from the dynamic view - you can just add this to the AND filter:

  • {
    	"kind": "NotFilter",
    	"filter": {
    		"kind": "TermFilter",
    		"field": "id",
    		"term": "{{id}}"
    	}
    }
    JSON