629

Product support

Get help in the plugin support forum.

Categories

IMPORTANT: Though we continue to support this project, we strongly recommend using the built-in October CMS feature called "Database Driven Themes" and the theme:sync console command

Dynopages plugin

This plugin adds possibility to use database for storing CMS pages, static pages, and static menus.

Features:

  • Store CMS pages in database
  • Store static pages and menus in database if RainLab.Pages plugin is installed and enabled.
  • Use RainLab.Translate plugin for localization if installed and enabled.
  • Migrate CMS pages, static pages, and static menus to database.

Installation

OctoberCMS backend

Search for 'Dynopages' in:

Settings > Updates&Plugins > Install plugins 

Console

php artisan plugin:install Rd.Dynopages

OctoberCMS Marketplace

You can find our plugin on OctoberCMS marketplace: https://octobercms.com/plugins

How to use?

  • Install and enable plugin.
  • Additional menu items will be available: Dyno CMS and Dyno Pages (if you are using RainLab.Pages for static content).
  • Use OctoberCMS in same way as with native CMS or Static Pages plugin.
  • For static menu we have created our own 'Static Menu' component. It extends RainLab.Pages 'Static Menu' component and allows to use static menus stored in database. We also added the possibility to use the actual page localized title on the menu (see usage example). In order to use component correctly please use correct item type in BE for menu generation.
Configuration:
Settings > Dynopages: general settings
  • Enable/Disable plugin
  • Show/hide native CMS in menu
  • Show/hide native static pages in menu
Migration:
Settings > Dynopages: migrations
  • Migrate existing CMS pages to database.
    • You can migrate separate page
    • You can migrate all pages
    • Page can be migrated if page with same file name doesn't already exist in database.
    • Be aware, that during migration all localized versions of page will be created, even if localized version of page doesn't exist in theme!
    • If during migration some field of localized page is not translated, data from default language will be used!
  • Migrate existing Static pages to database. You can migrate all static pages only. If at least one static page exists in database already, migration will not be possible!
  • Migrate existing Static menus to database. You can migrate separate menu items to database only. If menu item with same code exists, migration will not be possible for this menu item!
Available Components:
  • Static Menu. RainLab's Static Menu analog. Use it for your site in order to get correct static menus. See the example below, with localized pages titles (item.pageTitle).
  • Record List. RainLab's Record List analog from Builder plugin. Same usage as on native component, but with the ability to choose from correct pages.

Static menu usage example:

{% for item in staticMenu.menuItems if not item.viewBag.isHidden %}
   <li class="nav-item {{ item.items ? 'dropdown' : '' }}">
    {% if item.url %}
    {% set attributes = item.items ? 'role=button data-toggle=dropdown aria-haspopup=true aria-expanded=false' %}
    <a 
        class="nav-link {{ item.isActive ? 'active' : '' }} {{ item.viewBag.cssClass }} {{ item.items ? 'dropdown-toggle' : '' }}"
           href="{{item.url}}"
           {{ item.viewBag.isExternal ? 'target="_blank"' }}
           >
           {% if item.code %}
               <span>{{ ('nav.'~item.code)|_  }}</span>
           {% elseif item.pageTitle %}
               <span>{{ item.pageTitle }}</span>
           {% else %}
               <span>{{ item.title }}</span>
           {% endif %}

           {% if item.items %}
               <span class="icons icon-arrow-down"></span>
           {% endif %}
       </a>
       {% else %}
           <span>{{ item.title }}</span>
       {% endif %}

       {% if item.items %}
           <div class="dropdown-menu">
               {% for dropdownItem in item.items %}
                   {% if dropdownItem.code %}
                       <a 
                       class="dropdown-item" 
                       href="{{ dropdownItem.url }}">{{ ('nav.'~dropdownItem.code)|_  }}</a>
                   {% elseif dropdownItem.pageTitle %}
                       <a 
                       class="dropdown-item" 
                       href="{{ dropdownItem.url }}">{{ dropdownItem.pageTitle }}</a>
                   {% else %}
                       <a 
                       class="dropdown-item" 
                       href="{{ dropdownItem.url }}">{{ dropdownItem.title }}</a>
                   {% endif %}
               {% endfor %}
           </div>
       {% endif %}
   </li>
{% endfor %}

Plugin under development!!!

This plugin is still in development, so make sure to test it on dev/stage before going live. Please open new issue on our plugin’s GitHub issues page or contact us before adding negative comment about this plugin. We are trying our best to improve this plugin.

License

Dynopages plugin is open-sourced software licensed under the MIT license.

CMS pages migration

Integration

After installing and enable the plugin in the settings area, you will have two menu items in BE: Dyno CMS and Dyno Pages. Also, you can show/hide native CMS and Pages in the settings are too, to be able to compare contents.

Dyno CMS works the same as native CMS part of OctoberCMS but with small differences:

  • Pages will be saved in the database
  • New component will be available for you Dynopages > Static Menu. It is necessary to use this component in order to render correct menu items from the database.
  • Other parts will act the same way as on native CMS

Dyno Pages works the same way as native Pages of RainLab.Pages plugin but pages and menus will be saved in the database.

Components

The plugin currently includes only one component 'Static Menu' which extends functionality from RainLab.Pages plugin. It allows you to render menu items the same way as it's done on the native component (RainLab.Pages plugin Static Menu component), but use menu items stored in the database.

Database structure

Database tables:

  • rd_dynopages_pages - used for storing cms pages
  • rd_dynopages_static_menu - used for storing Static menus
  • rd_dynopages_static_pages - used for storing Static pages
  • rd_dynopages_static_pages_conf - used for storing BE menus for Static pages
  • Found the plugin not useful on 17 Jul, 2020

    A syntax error was detected in /plugins/anandpatel/wys
    iwygeditors/updates/version.yaml. Method addDays does not exist at line 45 (near " /vendor/october/rain/src/Parse/Yaml.php").

  • author

    Replied on 17 Jul, 2020

    /plugins/anandpatel/wys iwygeditors/updates/version.yaml. Method addDays does not exist at line 45 (near " /vendor/october/rain/src/Parse/Yaml.php") How this error is related to Dynopages plugin?

  • Found the plugin not useful on 6 Jul, 2019

    Men just installed and get this error count(): Parameter must be an array or an object that implements Countable

  • author

    Replied on 8 Jul, 2019

    Hi, Jesus Can you report a bug report on GitHub? We are still improving our plugin. Any bug report and suggestions are welcome. Actually, I have already fixed this error, that was related to not allowing count(null) in php.7.2. Now you can use migration!

1.0.5

Created table rd_dynopages_static_menu

Jul 05, 2019

1.0.4

Created table rd_dynopages_static_pages_conf

Jul 05, 2019

1.0.3

Created table rd_dynopages_static_pages

Jul 05, 2019

1.0.2

Created table rd_dynopages_pages

Jul 05, 2019

1.0.1

First version of DynoPages

Jul 05, 2019