Page Banner
Full-width hero banner for News, Event, and Spotlight pages. Automatically detects the page’s content type, reads its metadata, and renders the matching layout with engagement actions (like/comment/share) or event details (add-to-calendar, date & location panel).
Get Page Banner Working in 3 Steps
Prerequisites
- Bonzai 2 package installed on your site
- A modern page created from a supported page type (News Page, Event Page, or Spotlight Page)
Use a supported page type
Create a News, Event, or Spotlight page in the Site Pages library. The banner only renders on supported page content types — Spotlight pages use the News layout with “Spotlight” as the default category.
Add the web part (full-width recommended)
Edit the page and add “Bonzai Page Banner”. For best results, place it in a Full-width section. In Edit mode a warning appears if the web part is not in a full-width canvas section.
Adjust layout + visibility
Use the property pane to control height, overlay darkness, text alignment, and which metadata/actions display for the detected page type. Use the built-in image picker to override the page banner image from SharePoint, OneDrive, stock images, or by uploading a file to Site Assets.
When to Use This Web Part
Use this when you need to...
- Add a consistent, branded hero banner to News, Spotlight, and Event pages
- Show event details (date/location) as a structured panel on Event pages
- Enable quick engagement actions (like, comment, share) on News, Spotlight, and Event pages
- Offer multiple “Add to Calendar” options on Event pages (Outlook, Google, .ics)
Best page locations
- News pages — hero image + title + date + category/author + like/comment/share actions
- Spotlight pages — same as News, with “Spotlight” used as the default category
- Event pages — hero image + title + add-to-calendar + share + date/location panel
Consider alternatives when...
- • Standard site pages without a supported content type (the banner intentionally won’t render)
- • Page rollups (use News Rollup / Events Rollup / Spotlight Rollup instead)
Related web parts:
Recent Updates
- New: Author profile photo in News, Event, and Spotlight banners. A round avatar renders inside the “Posted By” block, between the label and the author-name link, sourced from
/_layouts/15/userphoto.aspx?size=M&accountname={email}. Configurable via the newshowAuthorImagetoggle andauthorImageSizeslider (16–48 px). Photos that 404 or accounts without an email gracefully collapse to today's text-only attribution — no broken-image artefacts. - Fixed: Add to Calendar success toast now stays visible for 1.5s after clicking Add to Outlook. Previously the dropdown unmounted in the same React frame as the toast, making the click look like a no-op even though the Graph call succeeded.
- Fixed: Add to Calendar dropdown is no longer clipped by the banner section's bottom edge. The hero overlay's
overflow: hiddenwas removed (image clipping is still handled viaobject-fiton the hero image), so the dropdown can extend past the banner box and its bottom rows render in full.
How it Works
- Detects page type: Inspects the page’s ContentTypeId prefix, content type name, case-insensitive alternate names (e.g. “News”, “News Page”), and falls back to
PromotedStateto catch standard SharePoint news posts that share the Site Page base content type. - Reads metadata from the page item: Uses dynamic field discovery to find common columns across different site setups — date, category, author/byline, banner image, and Show Likes / Show Comments. Discovery is case-insensitive and covers both friendly and encoded (
_x0020_) internal names, plusOwl*legacy columns. - High-resolution images: Banner image fields that carry a JSON payload are parsed to the original
serverRelativeUrlfile;getpreview.ashxURLs are bumped to the highest resolution bucket so you don’t get blurry thumbnails. - News / Spotlight banner actions: Like/unlike and comment count use SharePoint list item APIs. “Comment” scrolls to the comments section on the page (including nested scroll containers). “Share” copies the page URL to the clipboard.
- Event banner actions: “Add to Calendar” opens a dropdown that supports Outlook / Office 365 (Microsoft Graph), Google Calendar (link), and an .ics download. A structured Date & Location panel renders below the hero, with Full / Smart / Custom date formatting.
- All-day event detection: If the page has no explicit
fAllDayEventcolumn, the web part auto-detects all-day events by checking whether both dates share the same UTC hour with zero minutes (SharePoint stores site-timezone midnight as a non-zero UTC hour). - Respects page-level toggles: Like and Comment buttons automatically hide when the page hasShow Likes / Show Comments set to No, when SharePoint commenting is disabled (checked via Site Pages REST, list
DisableCommenting, and itemCommentsDisabled), or when a page-levelOwlShowPageLikes/OwlShowPageCommentscolumn is set to No. - Stays in sync: Like state and comment count are polled every 5 seconds while the page is open so the banner stays aligned with the native SharePoint comment feed and Like button.
- Built-in image picker: The property pane includes a FilePicker that lets you pick from SharePoint site files, OneDrive, Organisational assets, stock images, web search, or upload directly — uploads are saved into
SiteAssetswith a timestamped, sanitised filename.
Spotlight pages
Engagement buttons also work on Event pages
Graph permission required for Outlook add-to-calendar
Author profile photo respects tenant privacy
showAuthorImage in the property pane — the banner cleanly falls back to text-only “Posted By” attribution. Photos that fail to load (404) or accounts without an email address also collapse to text-only automatically, so you never see a broken-image placeholder.Common Configurations
Copy these ready-to-use configurations:
News Hero (Recommended)
News / Spotlight layout with engagement actions
| bannerHeight | 280 |
| overlayOpacity | 71 |
| imageFit | cover |
| showDate | On |
| showCategory | On |
| showAuthor | On |
| showBannerLikeButton | On |
| showBannerCommentButton | On |
| showShareButton | On |
| showCategoryBeforeAuthor | Category first |
Event Hero + Details
Event layout with calendar + date/location panel
| bannerHeight | 320 |
| overlayOpacity | 65 |
| showAddToCalendar | On |
| showShare | On |
| showBannerLikeButton | On |
| showBannerCommentButton | On |
| showDatePanel | On |
| showLocation | On |
| eventDateFormat | smart |
Minimal Banner
Title-first layout with lighter overlay
| bannerHeight | 240 |
| overlayOpacity | 45 |
| showCategory | Off |
| showAuthor | Off |
| showBannerLikeButton | Off |
| showBannerCommentButton | Off |
Reference
Property Pane Configuration
Page Banner shows different property groups depending on what page type it detects (News/Spotlight vs Event).
Layout
| Property | Type | Default | Description |
|---|---|---|---|
bannerHeight | Slider | 280 | Banner height in pixels. Slider range 180–480 (step 10). Recommended 240–320. |
overlayOpacity | Slider | 71 | Overlay strength (0–100, step 5) applied on top of the image to improve text readability. |
overrideImageUrl | Text + FilePicker | empty | Default banner image. When set, always replaces the page banner image. Leave empty to use the page’s own rollup/banner image. The picker below the text field lets you browse Recent, Site files, OneDrive, Organisational assets, Stock images, Web search, or Local upload / Link upload. Uploaded files are saved into SiteAssets with a timestamped, sanitised filename. |
textMarginLeft | Slider | 0 | Left inset (0–400 px, step 1) for the banner text block — useful for aligning the text with the page’s content column inside a full-width section. |
imageFit | Dropdown | cover | CSS object-fit for the hero image: cover (fill & crop), contain (fit, no crop), fill (stretch), none (original size), or scale-down. |
Visibility (News / Spotlight)
| Property | Type | Default | Description |
|---|---|---|---|
showDate | Toggle | On | Show the published date above the title. Falls back to the item’s Created date if no page-specific publish-date column is found. |
showCategory | Toggle | On | Show the category label (if present on the page item). Spotlight pages default to the category Spotlight when no value is set. |
showAuthor | Toggle | On | Show “Posted By {author}” with a link to the author’s SharePoint profile page. |
usePageAuthor | Toggle | On (Page Author field) | On: use the page content type’s custom author/byline field (e.g. OwlSpotlightPageAuthor, NewsPageAuthor, _AuthorByline). Off: always use the SharePoint system Created By author. |
showAuthorImage | Toggle | On | Show a round author profile photo next to the author name in the “Posted By” block. The photo is sourced from /_layouts/15/userphoto.aspx?size=M&accountname={email}. Hidden automatically if the author has no email or the photo 404s — the banner falls back to today's text-only attribution with no broken-image artefacts. |
authorImageSize | Slider | 24 | Diameter of the author profile photo in pixels (range 16–48 px, step 2). |
showBannerLikeButton | Toggle | On | Show the Like / Unlike button in the banner. Still respects the page’s own Show Likes setting and is hidden when page-level commenting is disabled. Like count updates every 5 seconds so the banner stays in sync with the native SharePoint Like button. |
showBannerCommentButton | Toggle | On | Show the Comments count button in the banner. Clicking it smooth-scrolls to the page’s comments section (including inside nested scroll containers). Still respects the page’s own Show Comments setting and is hidden when commenting is disabled. |
showShareButton | Toggle | On | Show the Share button. Clicking it copies the current page URL to the clipboard and displays a “Link copied” tooltip. |
showCategoryBeforeAuthor | Toggle | On (Category first) | When both Category and Author are visible, controls their order on the metadata line: On = Category first, Off = Author first. |
Visibility (Event)
| Property | Type | Default | Description |
|---|---|---|---|
showAddToCalendar | Toggle | On | Show the “Add To Calendar” action. Opens a dropdown with Outlook / Office 365 (Graph), Google Calendar link, and .ics download. |
showShare | Toggle | On | Show the Share button (Event layout). Clicking it copies the current page URL to the clipboard. |
showBannerLikeButton | Toggle | On | Show the Like / Unlike button on the Event banner. Still respects the page’s own Show Likes setting and is hidden when commenting is disabled. |
showBannerCommentButton | Toggle | On | Show the Comments count button on the Event banner. Clicking it jumps to the comments section. Still respects the page’s Show Comments setting. |
showDatePanel | Toggle | On | Show the Date & Location panel below the hero. |
showLocation | Toggle | On | Show the location row in the Date & Location panel (only appears when a location value exists on the page item). |
showCategoryBeforeAuthor | Toggle | On (Category first) | When both Category and Author are visible, controls their order on the metadata line (Category first vs Author first). |
eventDateFormat | Dropdown | full | How event date ranges are rendered in the panel: full (e.g. “Feb 10, 2026 12:00 AM to Feb 13, 2026 12:00 AM”), smart (e.g. “Feb 10–13, 2026”), or custom. |
usePageAuthor | Toggle | On (Page Author field) | On: use the page content type’s custom author/byline field (e.g. OwlEventPagePostedBy, EventPageAuthor). Off: always use the SharePoint system Created By author. |
showAuthorImage | Toggle | On | Show a round author profile photo next to the author name in the “Posted By” block. Sourced from /_layouts/15/userphoto.aspx?size=M&accountname={email}; collapses to text-only attribution when the photo is unavailable. |
authorImageSize | Slider | 24 | Diameter of the author profile photo in pixels (range 16–48 px, step 2). |
Colours
The Colours group always shows the useWhiteText, useWhiteOverlay, and dateColor fields. The remaining fields are contextual: activeButtonColor shows on News/Spotlight pages, while buttonColor and accentBorderColor show on Event pages.
| Property | Type | Default | Description |
|---|---|---|---|
useWhiteText | Toggle | On (White text) | On: banner text renders in white. Off: black text for light backgrounds. |
useWhiteOverlay | Toggle | Off (Black overlay) | Off: dark gradient overlay. On: white gradient overlay for light-themed banners. |
dateColor | Text (hex) | empty | Accent colour for the date and the author link. Overrides the White Text toggle for just those elements. Leave empty to follow the toggle. |
activeButtonColor | Text (hex) | #7EB0CC | News / Spotlight layout: background colour of the Like button when it is in the active (liked) state. |
buttonColor | Text (hex) | #005398 | Event layout: background colour for the Add to Calendar and Share buttons. Falls back to #555555 if left empty at render time. |
accentBorderColor | Text (hex) | #005398 | Event layout: colour of the left accent border and icons on the Date & Location panel. |