- Get started with theme development
- Gulp Viewport and Developer tools
- Theme development troubleshooting
- Password-protect content for anonymous users
- Advanced content rendering
- Develop Pluggable Placeholders
- Get help with theme development
- Page context
- Blog overview context
- Search context
- Error context
- Supported macros
- Theme guidelines
- Theme properties
- Search and SEO
Confluence/Viewport macros and features
- Enabling custom Source Code Highlighting
- Customizing the Attachments Macro in a Viewport
- Displaying and Adding User Comments
- Displaying forms
- Add a like button to pages, comments or attachments
- Adding a Slideshow
- Overriding the output of macros
- Customize RSS feed for blog posts
- "Share the page" in a Viewport
- (External) files and media
- Integration with other Scroll Add-ons
Integration with third-party software
- Displaying Additional User Information from the User Profile Plugin
- General 3rd party add-on implementation
- Integrating Disqus Comments
- Making Gliffy macros resizable
- Making UI-Expand macro of RefinedToolkit work
- Displaying Viewport Content in an iframe
- Integrate Midoris Archiving Plugin
- Trigger EliteSofts Page View Macro through Scroll Viewport
- Make your app compatible with Scroll Viewport
- Content Management via Page properties
- Context-Sensitive Help
You can use the built-in page properties macro to define SEO data and output it in a template.
Add Page Properties for a Page
Edit the page and create a page properties macro and create the SEO properties within a table (see the official documentation for more info how to create properties).
Left we have the keys you can access, and on the right there is the value to the page property. This way, you can store images, lists, links or just plain text. This information can be accessed within your Viewport.
Displaying the Content Properties
In your template, access the page properties with the
$!page.properties is used in this case because we don't want to output the variable name if it is not defined.
<head> <title>$!page.properties.metaPageTitle</title> <meta name="Description" content="$!page.properties.metaDescription"> </head>
Note that your page properties can also contain HTML – you can display them as text or as another resource form using HTML fragments.
Hiding Page Properties
By default page properties will be visible to everyone – usually, this should be avoided.
There are two ways of hiding them:
- Hide the properties by checking the Hidden setting for the page properties macro. The drawback of this approach is that you can only see the properties in the Confluence editor.
Use a macro override to only hide the page properties in the Viewport. To do so, create a velocity file in your theme: overrides/details.vm like this:
## override output of page properties macro to not show page properties
This will do the following:
- 'details' is the internal name for the page properties report. Viewport will pick up that file automatically to render all page property macros.
- The template only contains a comment, so Viewport will not render anything.