Download the PHP package nyeholt/silverstripe-frontend-livingdoc without Composer

On this page you can find all versions of the php package nyeholt/silverstripe-frontend-livingdoc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-frontend-livingdoc

Frontend Livingdoc

A frontend site content editing tool built in top of the LivingDocs engine.

Takes the lead from some of the work from https://github.com/wolfv/silverstripe-livingdocsfield and https://github.com/guru-digital/frontend-admin

Overview

This module allows you to edit structured HTML components from the frontend of the site. These components can be defined with editable regions allowing content "directives" to be inserted using

Components can be moved around the page and nested inside others, meaning content authors can define full page structures in-place without needing convoluted CMS managed object structures.

Getting started

The module ships with the LivingPage page type that can be created in the CMS. After creation, click the Edit this page in-place link to start modifying the page on the frontend of the site.

To enable global global shortcode configuration that can be added on all pages, add the following configuration (depending on whether you're using multisites or not)

Page templates

By default the ComponentPage will render within the global page layout defined for your site. To take full control of rendering the whole page, define a top level templates/ComponentPage.ss file that removes everything from the body tag except the $Layout keyword.

To make this futher configurable by users, set the ComponentPage.allow_full_page_mode: true config property to allow editors to select to control the full page layout, then change your ComponentPage.ss template to check whether the $FullPageMode variable is set when determining whether to only output the $Layout keyword.

Note: to properly make use of re-usable components, you'll likely want to define either some shortcodes to output repeatable parts of the site (see the ShortcodeMenu example) and wrap them in PageComponent objects via the CMS, or make use of the User Templates module and define these templates directly in the CMS too. See below for more on components

CMS capabilities

From the CMS you can define several things to help the page editing process

Shortcodes for embedding content in pages

These can be configured on the SiteConfig, or Site object for Multisites users, which will cascade throughout that site. Additional shortcodes can be specified on a per-page basis; these will override any defined at a global level. Specify a key value pair, where the 'key' is the label shown to the user, and the value is the shortcode to output. Note that users may add attributes for the shortcode from the frontend of the site.

Adding new shortcodes to a system is the normal SilverStripe method, eg

ShortcodeParser::get('default')->register('listing', array('PageShortcodes', 'listing_content'));

On the frontend of the site, shortcodes are added using the "Embed" component.

ComponentPageStructure

To provide some structure to pages, you can define a "Component Page Structure" in the CMS at admin/componentpage. When creating this structure, you can choose an existing Component Page to extract the content structure from.

Then, when you create a Component Page object in the Site Tree, you can choose the template structure to provide the initial content.

Page Component and Compound Component

Creating new components in the CMS is somewhat more straight forward than in a design file. From the Component pages section create a new Page Component

In many cases it may be simpler to create re-usable components from existing structures defined on a page. To do this, create a new Compound component. The initial fields have the same meaning as the Page component; however the markup should be copied from a set of components. Go to the component page, select a container of some sort, and click ctrl+c. (You'll see a small notice in the bottom right corner). Paste that into the markup area.

Compound Component

Image Paste

You can paste clipboard images in a few different contexts;

Custom designs

The module comes with a base "design" which is a set of components defined in JavaScript that define the HTML structure of those components, as well as which parts of those components are editable.

Components are made up of plain HTML, with a few specific directive attributes that indicate to livingdocs the editable areas of the structure. In addition to the HTML structure, components may have componentProperties applied to them, which are surfaced as CSS classes, as well as arbitrary data fields. One specific data field is the data_attributes map, which is applied as attributes against the element.

An example component:

The key points are that

Creating a new design

Assuming the default base bootstrap-design.js file is used, you can simply update those definitions by iterating the design object;

The design.components collection can then be iterated to change the existing definitions, or have new definitions pushed onto its list.

To specify your own custom design, you may like to start with the bootstrap design and update it, then bind it into configuration via

Directives

The page editor supports several directive types

Component groups

To simplify the interface, components can be grouped together under a common heading. See the groups key in the design file

Pre-defined component structures

In some cases it is desireable to always have a specific tree of components automatically created when a specific type of component is created. An example of this is a table component; it is almost always going to be the case that creating a <table> should also have headers and rows created.

There are two mechanisms for defining these, both of which use the same internal structure

Building new bundles

Limitations

The components in the current implemented design is based on Bootstrap 4, with the available components all based on a specific implementation that I needed at the time.

You can hook into the updateLivingdocsDesign JS event and change things there prior to it being loaded.

Key API parts

Get the current selected component

LivingDocState.activeComponent

Future work


All versions of silverstripe-frontend-livingdoc with dependencies

PHP Build Version
Package Version
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nyeholt/silverstripe-frontend-livingdoc contains the following files

Loading the files please wait ....