<m7-view> Attribute Reference
<m7-view> is a standard Web Component (Custom Element) registered by the Module7 loader script. It is fully self-contained — no public JavaScript API, no events, no slots.
All configuration is done through HTML attributes. For CMSes that strip unknown elements, the same attributes work with a data- prefix on a plain <div data-m7-view> — see Fallback element.
Attributes
token (required)
Your Integration Key, issued by Venus AI. Sent as the Integration-Key header with every request to the Module7 server. The key encodes your module configuration and restricts usage to the domains you have registered.
<m7-view token="your-integration-key"></m7-view>
If this attribute is missing or empty, the element renders an error immediately without making any server request.
view
Forces a specific view to render, regardless of the current page URL.
<m7-view token="..." view="listing"></m7-view>
Valid values:
| Value | Description |
|---|---|
listing | Standard list view |
minimal | Compact list view |
grid | Grid layout |
maps | Map-only view |
listing-maps | List and map side by side |
split-maps | Split view with map |
grid-maps | Grid layout with map |
bookmarks | Saved/bookmarked items |
snowreport | Snow report view |
slide | Slideshow view |
detail | Single entity detail view |
landing | Landing page view |
If view is omitted, Module7 resolves the view from window.location.pathname. For example, a page at /listing will render the listing view automatically. If the path does not match any known view, an UNKNOWN_VIEW error is shown.
filter
Pre-applies a static filter to the view. Supports both path segments and query parameters using the filter-link format.
<!-- Path segment filter (persistent across navigation) -->
<m7-view token="..." view="listing" filter="type=schema:MusicEvent"></m7-view>
<!-- Query parameter filter (discarded on navigation) -->
<m7-view token="..." view="listing" filter="?time=next_week"></m7-view>
<!-- Combined -->
<m7-view token="..." view="listing" filter="type=schema:MusicEvent?time=next_week"></m7-view>
Filters set here are merged with any filters already present in the URL. The view attribute does not need to be set for filter to work.
project
Restricts the view to one or more specific projects, overriding the projects configured in your Integration Key.
<m7-view token="..." project="671092r25dgdq0mae7b3c12f"></m7-view>
Accepts a comma-separated list of 24-character hex IDs. Multiple projects can also be joined with _:
<m7-view token="..." project="671092r25dgdq0mae7b3c12f,5f43a2b1c0d9e8f712345678"></m7-view>
If any ID does not match the expected format, an INVALID_PROJECT error is shown and no request is made.
channel
Restricts the view to one or more specific channels, overriding the channels configured in your Integration Key. Accepts the same format as project.
<m7-view token="..." channel="671092r25dgdq0mae7b3c12f"></m7-view>
If any ID does not match the expected format, an INVALID_CHANNEL error is shown and no request is made.
mode
Controls how the SSR render is executed. In normal operation this attribute does not need to be set.
| Value | Behavior |
|---|---|
server-side | Default. The server uses its SSR cache when available. |
client-side | The server skips the SSR cache and renders fresh. Useful for debugging stale cache issues. |
<m7-view token="..." mode="client-side"></m7-view>
Combining attributes
All attributes can be combined freely:
<m7-view
token="your-integration-key"
view="listing"
project="671092r25dgdq0mae7b3c12f"
filter="type=schema:MusicEvent?time=next_week">
</m7-view>
Fallback element
CMSes that sanitize HTML may remove <m7-view> as an unknown tag. Use a standard <div> with the data-m7-view marker attribute instead. All attributes work identically with a data- prefix:
<div
data-m7-view
data-token="your-integration-key"
data-view="listing"
data-filter="type=schema:MusicEvent"
data-project="671092r25dgdq0mae7b3c12f"
data-channel="671092r25dgdq0mae7b3c12f"
data-mode="client-side">
</div>
The loader upgrades these placeholders to proper <m7-view> elements automatically on page load, stripping the data- prefix from all attributes.
Error handling
Errors are displayed as a styled message inside the element's shadow DOM — visible to end users if something is misconfigured. Each error has a code shown in the footer.
Attribute validation errors
These are caught before any server request is made:
| Code | Cause |
|---|---|
MISSING_TOKEN | token attribute is absent or empty |
INVALID_PROJECT | A project ID is not a valid 24-character hex ID |
INVALID_CHANNEL | A channel ID is not a valid 24-character hex ID |
INVALID_FILTER | The filter value does not match the filter-link format |
UNKNOWN_VIEW | The view could not be resolved — neither view attribute nor the current URL path matches a known view |
Server errors
These occur after the POST request:
| Code | Cause |
|---|---|
SERVER_ERROR | The Module7 server returned a non-2xx response. The HTTP status code is included in the message. |
MISSING_MOUNT_TARGET | The server response did not contain a valid mount point. Indicates a server-side rendering failure. |
MISSING_RENDER_OPTIONS | The mount point was found but render options were missing from the server response. |
DEFAULT | Any other uncaught error during element setup or rendering. |
Console errors (prefixed m7-view:, [m7-mirror], or [m7-assets]) provide additional detail for debugging without affecting the visible error state.