Technical reference
The search popup edit plugin adds an Edit Popup search result field to the Brightspot CMS tool, along with the site setting and page assets needed to open an asset's edit page in a popup instead of navigating away from search results.
Dependencies
This plugin has no dependencies beyond the standard Brightspot CMS and Dari libraries.
Installation
- Maven
- Gradle
- Gradle (Kotlin DSL)
<!-- Requires Brightspot 5.0 or later. -->
<dependency>
<groupId>com.brightspot.search-popup-edit</groupId>
<artifactId>search-popup-edit</artifactId>
<version>1.0.0</version>
</dependency>
// Requires Brightspot 5.0 or later.
implementation 'com.brightspot.search-popup-edit:search-popup-edit:1.0.0'
// Requires Brightspot 5.0 or later.
implementation("com.brightspot.search-popup-edit:search-popup-edit:1.0.0")
API reference
PopupEditSearchResultField
Implements SearchResultField to add the Edit Popup column to CMS search results.
| Method | Returns | Description |
|---|---|---|
#getDisplayName() | String | Returns the column header text, "Edit Popup". |
#isSupported(ObjectType) | boolean | Returns true unless PopupEditSearchResultFieldSiteSettings#getHidePopupEditSearchResultField is true for the current site. |
#isDefault(ObjectType) | boolean | Returns the same value as #isSupported(ObjectType), so the column shows by default whenever it is supported. |
#createDataCellText(Object) | String | Returns an empty string. The cell content comes from #getDataCell(Object) instead. |
#getDataCell(Object) | TrContent | Returns a table cell containing a link to the asset's edit page, marked with the EditPopupIcon CSS class and data-popup-mode attribute that PopUpEditToolPageHead targets with CSS and JavaScript. |
PopupEditSearchResultFieldSiteSettings
Extends Modification<SiteSettings> to add the site setting that hides the Edit Popup column. Field values are stored with the internal name prefix cms.search.editpopup..
| Member | Type | Description |
|---|---|---|
#getHidePopupEditSearchResultField() / #setHidePopupEditSearchResultField(boolean) | Boolean | The site setting value, grouped under the Search cluster in the tool UI. |
#isHidePopupEditSearchResultField() | boolean | Returns true only if the setting is explicitly set to true. |
#get(Site, Function) (static) | T | Reads a value from the given site's settings, falling back to the equivalent setting on the singleton CmsTool if the site does not set a value. |
PopUpEditToolPageHead
Implements ToolPageHead to inject the CSS and JavaScript the Edit Popup column needs. #getElement() returns a stylesheet link for edit-popup.css and an inline script that intercepts clicks on .EditPopupIcon links in the capture phase, so Brightspot's search result click handling does not hijack them before they can open in a popup.
Configuration
| Setting | Cluster | Type | Default | Effect |
|---|---|---|---|---|
| Hide Popup Edit Search Result Field | Search | Boolean | Not set (column shown) | When true for a site, or for the CMS Tool if the site does not set it, hides the Edit Popup column from that site's search results. |