Back to overview

Custom Pages

Add it on-the-fly to your HumHub by activating it in the Modules menu! ("Administration -> Modules")

No screenshots available.

The custom pages modules allows the creation of customized pages and snippets as well as on space global level.

Depending on content type and target the following content types are available:

  • MarkDown (HumHub Markdown Richtext based page)
  • Link (External link)
  • Iframe
  • Template
  • Html (Only available for global pages for security reasons)
  • PHP (requires further activation under Administration -> Custom Pages -> Settings)

By default the module supports the following targets for global pages:

  • Top Navigation
  • User Account Menu (Account Settings)
  • Directory Menu
  • No Specific target (Direct link)

and global Snippets:

  • Dashboard
  • Directory

On space level the following page targets are supported by default:

  • Space Navigation

and snippets:

  • Stream Sidebar

Since v.1.0 external modules can provide own targets through the CustomPagesService.

Module website: https://github.com/humhub/humhub-modules-custom-pages
Author: luke, buddh4
Author website: humhub.org

Changelog

https://github.com/humhub/humhub-modules-custom-pages/commits/master

Bugtracker

https://github.com/humhub/humhub-modules-custom-pages/issues

Getting Started

Global pages and snippets can be maintained by administrators in Administration -> Custom Pages -> Overview.

Space pages and snippets require additional module installation on space level and can be maintained by space administrators in Space Settings Dropdown -> Custom Pages.

After selecting a target for your new page as for example the Top Navigation, you have to select a content type. On space level the available content types are limited for security reasons.

Most content types provide the following setting which may vary between different targets:

SettingDescription
TitlePage link or Snippet title
Page Content or urlE.g. Iframe link or Markdown content
Url shortcutIf your installation supports pretty urls, this page setting can be used to create page urls as www.example.de/p/mypage
IconPage icons are used for menu link. Snippet icons are displayed beside the title in the snippet head
Sort OrderUsed for ordering your sidebar or navigation
Style ClassThis class will be added to the root of your page or snippet
Only visible for adminsThe page should only be displayed for system or space admin users, this can also be used while concepting a page
Open in new windowThis setting can be used for pages in order to open the page in a new window (tab)

Templates

The custom pages module provides a simple template mechanism based on twig. Templates can be maintained under Administration -> Templates.

Note: In order to use template based pages or snippets on space level, you'll have to allow the layout for spaces within the general settings of the template.

Layouts

When creating a new template based page or snippet, you have to select a layout template which is used as the base layout of your page. Usually a layout will consist of static elements as for example a headline, subheadline and container elements.

You can add the following static elements to your layout:

TypeDescription
TextA simple plain text element
RichtextA Html richtext editor based on CKEditor
HumHub RichtextThe HumHub Richtext, can be used for mentionings, oembed etc.
ImageImage element
FileRenders a file url (no link etc)
File DownloadRenders a file download link

A very simple layout could look like the following:

<style>
 // Some additional styling 
<style>

<div class="row">
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                {{ headline }}
            </div>
            <div class="panel-body">
                <div class="abstract">
                    {{ abstract }}
                </div>
                <div class="abstract">
                    {{ content }}
                </div>
            </div>
        </div>
    </div>
</div>

With a simple text element as headline, a HumHub Richtext as abstract and a container element which allows multiple container items.

Container

A container element can contain one or multiple container items. Container items themselves are based on templates managed under Administration -> Tempaltes -> Container. A container element can either act as container of inline or block elements or just allow a single element. Furthermore a container element can restrict the allowed types of container items.

The following example shows a simple quotation container element with two text elements text and info:

<blockquote>
    {{ text }}
</blockquote>
<span>{{ info }}</span>

Another container example with a figure and floating text based upon a image image element and figcaption text element:

<figure class="pull-left">
    {{ image }}
</figure>
<figcaption>{{ figcaption }}</figcaption>

<p> {{ text }}</p>

1.0.4 (November 05, 2019)

  • Fix: Added missing ckeditor plugins

1.0.3 (October 31, 2019)

  • Fix: Use of wrong content visibility in page migration
  • Fix: Guest access for public global pages

1.0.2

  • Enh: Update Ckeditor to v4.13.0

1.0.1

  • Enh: 1.4 nonce compatibility

1.0.0 (February 25, 2019)

  • Enh: Added integration layer
  • Enh: New template content type HumHub Richtext
  • Enh: Use Markdown Richtext as Markdown editor
  • Chng: Aliged CustomContentContainer tables and controller logic
  • Enh: Added blank system template
  • Chng: Content are public by default if admin_only is not enabled
  • Enh: Added codemirror editor
  • Enh: Order templates by name
  • Fix: onBeforeUnload not working with pjax
  • Fix: default data reset throws error
  • Enh: Added inline_text flag to text content

0.8.14 (April 5, 2019)

  • Fix: Missed confirm box on page deletion

0.8.13 (February 25, 2019)

  • Fixed xss vulnerability issue

0.8.12 (February 05, 2019)

  • Fix: Space admin can't add template components
  • Chng: Updated min version to 1.3.0

0.8.11 (February 01, 2019)

  • Enh: Updated translations
  • Fix #89: XSS vulnerability

0.8.10 (October 27, 2018)

  • Enh: Translation updates

0.8.9 (October 04, 2018)

  • Fix: Iframe loader not removed

0.8.8 (September 18, 2018)

  • Fix: Use of deprecated jQuery load instead of .on('load')

0.8.6 (July 13, 2018)

  • Fix: added missing custom directories

0.8.5 (July 12, 2018)

  • Fix: added check for php page active in php file count check
  • Fix: edit snippet not working in addition with footer nav

0.8.4 (July 2, 2018)

  • Fix: PHP 7.2 compatibility issues

0.8.3

  • Fix: 1.3 compatibility
  • Fix: 1.2.0 compatibility

0.8.2:

  • Chg: Use of 'Pages' overview as first admin page

0.8:

  • Fix #73: Richtext uploads not attached on initial edit;
  • Fix #33: fixed strict access for global pages
  • Fix #68: wrong translation key
  • Enh: Added page type PHP
  • Enh: Added module setting page

0.7.13:

  • Fix: Error with FileManager afterSave logic
  • Enh: Open FileDownload items in new window

0.7.9:

  • Enh: Allow target _blank links in richtext

0.7.8:

  • Enh: Added directory menu pages

0.7.7:

  • Enh: Added file download content + download item/download list template
  • Enh: Usability enhancements
  • Fix: Add item with only one allowed template not working
  • Enh: Allow Inline Activation only for certain container items
  • Enh: Added template elemen title field
  • Enh: Use select2 dropdown as template select

0.7.6:

  • Fix: Iframe page size fix.

0.7.5:

  • Fix: edit snippet issue.
  • Fix: icon 'none' in snippet icon selector.
  • Fix: Don't show container page in stream.

0.7.4:

  • Fix: select2 template selection shrink if rendered in hidden panel
  • Fix: Cancel button color
  • Fix: Fixed account setting template page container issue
  • Enh: #56 Use of select2 dropdown as icon chooser
  • Fix: #40 Image/File upload ajax error handling
  • Fix: HumHub 1.2.beta.3 support
Version:
1.0.4 (released a month ago)

Publisher:
HumHub GmbH & Co. KG

Compatibility:
HumHub 1.3.10 - Latest





HumHub Cloud

Free
Install it on-the-fly at the admin panel
in your HumHub hosting instance


HumHub Self-Hosted

Free
Install it on-the-fly at the admin panel
in your HumHub installation