Git Product home page Git Product logo

omeka-module-starter-kit's Introduction

Omeka-S Module Starter Kit

This starter kit is aimed at developers who want to develop modules for Omeka-S (https://github.com/omeka/omeka-s) and get up and running quickly. It provides a skeleton to work with and an IDE friendly development experience.

Requirements & Rationale and how to remove them.

  • PHP 7 - in our example we explore how to use PHP 7s scalar types to aid configuration management, in addition to an alternative template rendering system which currently requires PHP 7 to run. You can remove this dependency when creating your own module by removing scalar type hints and amending the composer.json.
  • Twig - In order to render the twig templates you will need an Omeka-S installation with the ZfcTwig extension.

Installation

Repository

Clone this repository into your modules folder in Omeka-S

$ cd modules
$ git clone [email protected]:stephenwf/omeka-module-starter-kit.git OmekaModuleStarterKit

and run composer install from the folder

$ cd OmekaModuleStarterKit
$ composer install
ZfcTwig (optional)

If you would like to use Twig and see the example in twig running you need to install a Zend extension. To continue without twig, see the instructions below.

In the root of your Omeka-S installation:

$ composer require kokspflanze/zfc-twig

In your application/config/application.config.php add ZfcTwig to the first array:

<?php
$reader = new Zend\Config\Reader\Ini;
return [
    'modules' => [
        'Zend\Form',
        'Zend\I18n',
        'Zend\Mvc\I18n',
        'Zend\Mvc\Plugin\Identity',
        'Zend\Navigation',
        'Zend\Router',
        'Omeka',
        'ZfcTwig', // <-- Add this line
    ]
...

With that installed, you can use twig templates in your module.

Running

To see the example after installing, go to your Omeka-S site, in the admin section go to your modules and enable the "OmekaModuleStarterKit" to enable it. You should now, while logged in as an admin, be able to go to /starter-kit/movies and see it all working together.

Compilation

The main addition in this starter kit is access to Composer and the wide range of libraries you can install from it. One issue with this is distributing modules as zip files. In this starter kit you can run a "compilation" set to create a zip file with your composer dependencies bundled. This is currently experimental, and may cause issues if you install conflicting dependencies.

To compile your module, make sure you run the installation steps above, and then run this from the root of your module:

./bin/package

If successful you will have a zip file in a build directory of your module. This is fully portable and can be dropped in another Omeka-S installation with ease.

Packagist

You can also submit your module to packagist (https://packagist.org/) and have your users pull it down in their omeka-s installation just like a normal composer dependency. This is currently un-tested, but should result in a better resolution of package versions than the zip method.

omeka-module-starter-kit's People

Contributors

stephenwf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

apricot13

omeka-module-starter-kit's Issues

Error going to "/starter-kit/movies" after install

I went through the installation steps as described, but after I install the module in Omeka and try going to "/starter-kit/movies", I see the following error:

Zend\Permissions\Acl\Exception\InvalidArgumentException: Resource 'Omeka\Controller\Admin\StarterKit' not found in /home/schaffer/(website)/vendor/zendframework/zend-permissions-acl/src/Acl.php:291

I have tried installing twice and I keep receiving this error and I don't know how to troubleshoot it. I've already started a topic in the Omeka.org help forum, but someone said I should contact the module developer.

If you could please help steer me in the right direction so I can make sense of this, I would very much appreciate it.

Thanks!

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.