Giter Site home page Giter Site logo

static_section's Introduction

Static Section

Static Sections simplify the process of editing field collections that should only exist once in Symphony.

Installation

  1. Upload the 'static_section' folder found in this archive to your Symphony 'extensions' folder.

  2. Enable it by selecting the "Static Section" extension, choose Enable from the 'With Selected' dropdown menu, then click Apply.

  3. Bluprints > Sections and edit some section that you'll "Make this section static (i.e a single entry section)".

Important Notes

  1. When adding to a previously created section, please ensure that the section contains only one entry.
    If added to a section that contains multiple entries, only the first entry in that section will be
    available to edit until the "Static Section" flag is removed from the section

  2. This extension does not modify the section data source output.
    As such if there are additional entries (more than one) in the section, these additional entries
    will still be output by Symphony when selecting the section as a data source.

Compatibility

Symphony Static Section
2.0 โ€“ 2.0.5 Not compatible
2.0.6 โ€“ 2.2 1.5
2.2.* latest

Changelog

1.6.1

  • when static section, <h2> element from publish/edit and publish/new page contains section name
  • refactored the code

1.6

  • rewrite for Symphony 2.2.1 new delegates

static_section's People

Contributors

brendo avatar icek avatar knupska avatar michael-e avatar rainerborene avatar simoneeconomo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

static_section's Issues

Make the method isStaticSection public

Hi! I wrote an extension that adds button to the backend of Symphony. Since these buttons should not be displayed in a static section, it could be nice to use your method instead of the copy/paste I made..

The purpose of this is to permit you to modify your logic as when and how a section is declared static, while keeping other extensions from crashing if your logic changes.

What do you think ?

Warnings in the logs / issues in section editor

I am finding strange warnings in the logs when using the static section extension:

2010/02/14 17:49:10 > WARNING: 2 - DOMDocument::loadHTML() [domdocument.loadhtml]: Tag recipient-groups invalid in Entity, line: 370 in file /Users/me/Sites/dev/me/email-newsletters/extensions/static_section/extension.driver.php on line 82
2010/02/14 17:03:09 > WARNING: 2 - DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: Tag group invalid in Entity, line: 1721 in file /var/www/www.meistro.de/extensions/static_section/extension.driver.php on line 82
2010/02/14 17:03:09 > WARNING: 2 - DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: Tag group invalid in Entity, line: 1721 in file /var/www/www.meistro.de/extensions/static_section/extension.driver.php on line 82
2010/02/14 17:03:09 > WARNING: 2 - DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: ID fields[-1][location] already defined in Entity, line: 1793 in file /var/www/www.meistro.de/extensions/static_section/extension.driver.php on line 82
2010/02/14 17:03:09 > WARNING: 2 - DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: ID fields[-1][location] already defined in Entity, line: 1825 in file /var/www/www.meistro.de/extensions/static_section/extension.driver.php on line 82
2010/02/14 17:03:09 > WARNING: 2 - DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: ID fields[-1][location] already defined in Entity, line: 2094 in file /var/www/www.meistro.de/extensions/static_section/extension.driver.php on line 82
2010/02/14 17:03:09 > WARNING: 2 - DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: ID fields[-1][location] already defined in Entity, line: 2362 in file /var/www/www.meistro.de/extensions/static_section/extension.driver.php on line 82

At the same time, the contents of textareas in the section editor are changed -- whitespace is stripped there. I double-checked that this whitespace issue disappears when I disable the Static Section extension. (I am using a custom field which has a texarea input for XML, saved to the database as text. Saving works fine, including whitespace.)

It does not make any difference if I make the section in question "static" or not.

Setup: Symphony 2.0.6 / Static Section 1.5

Just a small typo

There's a superfluous space in line 40 of field.static_section.php:

$this->_engine-> Database->query("DELETE FROM `tbl_fields_".$this->handle()."` WHERE `field_id` = '$id' LIMIT 1");

should be:

$this->_engine->Database->query("DELETE FROM `tbl_fields_".$this->handle()."` WHERE `field_id` = '$id' LIMIT 1");

Field should not be visible/selectable in Datasource Editor

The Static Section field should not be selectable in the DS editor. This could be achieved by adding the following function to the field class:

/**
 * Override 'include elements' (datasource edit page)
 * do not include anything
 */
public function fetchIncludableElements()
{
    return;
}

Errors in the log

The extension does not create a ("dummy") table for the static section field. The missing table causes errors in the logs each time the datasource is called (no matter if the field is included in the datasource output).

I wouldn't mind having an empty table in the database. The logic simply is "each field has a table".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.