Code Monkey home page Code Monkey logo

section_schemas's Introduction

Section Schemas

Installation

  1. Upload the 'section_schemas' folder in this archive to your Symphony 'extensions' folder.
  2. Enable it by selecting "Section Schemas" from the System > Extensions menu, choose Enable from the with-selected menu, then click Apply.
  3. Navigate to Blueprints > Data Sources, click Create New and choose Section Schema from the "Source" dropdown

Usage

  1. Create a schema data source by choosing the section and the fields to include
  2. Attach the data source to a page

I get weird errors!

Some fields simply are not compatible with this extension, because I use some slightly nefarious procedures to get the data I need. I'm abusing methods in Symphony's core which weren't really meant for this. It works for most fields, but some throw a hissy-fit, so I keep an array of these and ignore them from the schema output:

$_incompatible_publishpanel = array('mediathek', 'subsectionmanager', 'imagecropper', 'readonlyinput', 'author', 'entry_versions', 'status');

If you get errors from other fields, let me know and I'll add them to this array. Alternatively, don't select them when creating the data source.

But if your complex field is throwing errors and you still want it to play nicely with the extension, go ahead and implement an appendFieldSchema method in your field which returns an XMLElement representing the schema of your field. Read more in issue #6.

section_schemas's People

Contributors

brendo avatar davecoggins avatar nickdunn avatar nitriques avatar tonyarnold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

section_schemas's Issues

Fatal error: Class

I'm getting this error when I attach certain Section Schema data sources to a page:

Fatal error: Class 'Administration' not found in /Users/stephen/Sites/bauhouse/www/symphony/lib/toolkit/fields/field.author.php on line 53

It doesn't happen with all Section Schema data sources. I haven't quite figured out whether there is a particular field type that is triggering the problem. I'll try to look into this a little further.

Fatal error: Declaration of SectionSchemaDatasource::grab() must be compatible with that of iDatasource::grab()

Hey mate, this one is plaguing me at the moment with Symphony from integration.

Fatal error: Declaration of SectionSchemaDatasource::grab() must be compatible with that of iDatasource::grab() in /Users/tonyarnold/Sites/tonyarnold.com/extensions/section_schemas/data-sources/datasource.section_schema.php on line 7

Call Stack:
    0.0011     659344   1. {main}() /Users/tonyarnold/Sites/tonyarnold.com/index.php:0
    0.0268    5081864   2. Administration->display() /Users/tonyarnold/Sites/tonyarnold.com/index.php:25
    0.0268    5083064   3. Administration->__buildPage() /Users/tonyarnold/Sites/tonyarnold.com/symphony/lib/core/class.administration.php:381
    0.0512   10000840   4. AdministrationPage->build() /Users/tonyarnold/Sites/tonyarnold.com/symphony/lib/core/class.administration.php:228
    0.0512   10000840   5. AdministrationPage->canAccessPage() /Users/tonyarnold/Sites/tonyarnold.com/symphony/lib/toolkit/class.administrationpage.php:333
    0.0512   10000840   6. AdministrationPage->getNavigationArray() /Users/tonyarnold/Sites/tonyarnold.com/symphony/lib/toolkit/class.administrationpage.php:432
    0.0512   10000840   7. AdministrationPage->__buildNavigation() /Users/tonyarnold/Sites/tonyarnold.com/symphony/lib/toolkit/class.administrationpage.php:736
    0.0555   10720712   8. ExtensionManager::getInstance() /Users/tonyarnold/Sites/tonyarnold.com/symphony/lib/toolkit/class.administrationpage.php:830
    0.0555   10720712   9. ExtensionManager::create() /Users/tonyarnold/Sites/tonyarnold.com/symphony/lib/toolkit/class.extensionmanager.php:124
    0.0556   10736656  10. require_once('/Users/tonyarnold/Sites/tonyarnold.com/extensions/section_schemas/extension.driver.php') /Users/tonyarnold/Sites/tonyarnold.com/symphony/lib/toolkit/class.extensionmanager.php:869
    0.0560   10884824  11. require_once('/Users/tonyarnold/Sites/tonyarnold.com/extensions/section_schemas/data-sources/datasource.section_schema.php') /Users/tonyarnold/Sites/tonyarnold.com/extensions/section_schemas/extension.driver.php:3

Error creating datasources

Parse error: syntax error, unexpected '<', expecting ')' in /Users/johnporter/Projects/Websites/Open Book Publishers/assets.openbookpublishers.com/httpdocs/workspace/data-sources/data.section_schema_artists.php on line 18

The placeholder for dependencies is left in the datasource.

Incompatible Extensions

So, was chatting today with @pixelninja and we thought of a neat way that might help this 'incompatible extension' mess. At the moment the extension driver has this $incompatible_publishpanel variable, and you add to it extension handles that you don't want to be parsed. That's cool, but it's ugly with submodules, and it means that it's nearly always behind the times a little.

What about you could set the incompatible extensions through the Preferences page? A select box could list all the installed extensions in your site and you could select the ones that you wanted Section Schemas to ignore? This also means people don't have a chance to get the handles wrong.

This is like being able to chose what fields you want to include in the SS output (just like included elements on a normal datasource), and might already be under consideration for your 2.3 update, but nevertheless, whatcha think?

PHP Fatal Error for taglist on Sym2.3beta3

Symphony 2.3beta3 - When using a section schema datasource to get a taglist from a section throws PHP Fatal Error

Call to a member function fetchCol() on a non-object in .../section_schemas/data-sources/datasource.section_schema.php on line 251

Fix:

Changing data-sources/datasource.section_schema.php line #251 from

$total = Frontend::instance()->Database->fetchCol('count', sprintf('SELECT COUNT(handle) AS count FROM tbl_entries_data_%s WHERE handle="%s"', $field['id'], $handle));

to

$total = Symphony::Database()->fetchCol('count', sprintf('SELECT COUNT(handle) AS count FROM tbl_entries_data_%s WHERE handle="%s"', $field['id'], $handle));

seems to fix it in, datasource works and generates correct (expected) XML for the frontend

(I didn't add this as a pull request since I'm very new to Symphony extension editing and wasn't sure if this is the correct way to fix this, just seems to work re: your Updating Extensions for Symphony 2.3 blog post)

PS - Thanks for all your great extensions!

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.