Publications View
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
PXP > 5.0.0
This configuration was sufficient:
{
"type": "navigate",
"path": "publications"
}PXP automatically injected the publication into the context.
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.
{
"type": "navigate",
"path": "publications",
"params": {
"publication": "$context.publication.id"
}
}Content Navigation
The same rule applies when navigating to any content view.
PXP > 5.0.0
{
"type": "navigate",
"path": "content_view"
}PXP < 5.0.0
{
"type": "navigate",
"path": "content_view",
"params": {
"content": "$context.content.id"
}
}Prerequisites
- A Publication Data Sourcepublication data source is properly configured
- A Content Data Sourcecontent 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