Publications View
10 min
this document explains how to configure the publications view in pxp, including the required changes introduced in version 5 0 0 the publications view is used to display content belonging to a specific publication featuring the latest (current issue) content of that publication user flow in many projects, you need to display content related to a specific publication (e g , all articles from publication x , including the latest issue) typically a user taps on a publication component in a view (e g , home) this triggers a navigation action the app navigates to the publications view , which displays the latest issue other related content ⚠️ important change in pxp 5 0 0 before pxp 5 0 0 this configuration was sufficient { "type" "navigate", "path" "publications" } pxp automatically injected the publication into the context since pxp 5 0 0 you must explicitly pass the publication id using params this also applies to any issue, publication, category or content view, which must be navigated to having their respective parameters with the proper ids explicitly set ✅ correct configuration { "type" "navigate", "path" "publications", "params" { "publication" "$context publication id" } } content navigation (also updated) the same rule applies when navigating to any content view ❌ incorrect { "type" "navigate", "path" "content view" } ✅ correct { "type" "navigate", "path" "content view", "params" { "content" "$context content id" } } prerequisites a publication data source is properly configured a content data source is properly configured pxp version >= 5 0 0 how to setup 1\ example home view (publication list) { "name" "home", "appbar" "default", "content" \[ { "type" "list", "template" "horizontal", "content" { "type" "publication" }, "datasource" { "type" "publication" }, "tapentry" { "type" "navigate", "path" "publications", "params" { "publication" "$context publication id" } } } ] } 2\ example publications view { "name" "publications", "path" "publications", "appbar" "default", "content" \[ { "type" "content", "template" "highlight", "datasource" { "type" "content", "filter" { "id" { "value" "$context publication currentissueid" } } } }, { "type" "list", "template" "grid", "content" { "type" "content", "template" "cover" }, "datasource" { "type" "content", "filter" { "and" \[ { "publication" { "id" { "value" "$context publication id" } } }, { "id" { "value" "$context publication currentissueid", "negated" true } } ] } } } ] } key concept the "publications" view relies entirely on the navigation context 👉 if params publication is missing $context publication will be undefined the view will fail to load correctly faqs ❓ why is my publications view empty? missing params publication in navigation ❓ why does navigation work in older projects but not now? pxp 5 0 0 removed implicit context injection you must now pass parameters explicitly