lambdacms-media: LambdaCms "media" extension

[ library, mit, web ] [ Propose Tags ]

LambdaCms is a Content Management System (CMS) in Haskell using Yesod. This package contains the "media" extension.


[Skip to Readme]

Modules

[Last Documentation]

  • LambdaCms
    • LambdaCms.Media
      • LambdaCms.Media.Message

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1, 0.0.2, 0.2.0, 0.3.0, 0.3.0.1, 0.4.0.0
Change log CHANGES.md
Dependencies base (>=4.3 && <5), directory, filepath, lambdacms-core (>=0.0.7.3 && <0.2), persistent, shakespeare, text, time, yesod, yesod-form [details]
License MIT
Copyright (c) 2014-2015 Hoppinger BV
Author Mats Rietdijk, Cies Breijs
Maintainer mats@AT-hoppinger.com
Category Web
Home page http://lambdacms.org
Bug tracker https://github.com/lambdacms/lambdacms-media/issues
Source repo head: git clone git://github.com/lambdacms/lambdacms-media.git
Uploaded by cies at 2015-04-18T21:17:59Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 3767 total (16 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2015-04-19 [all 7 reports]

Readme for lambdacms-media-0.2.0

[back to package description]

lambdacms-media

This is an extension for LambdaCms which allows admins to manage media files.

NOTE: At this point the functionality provided by this extension is very basic. Pull request adding features are most welcome.

Installing

LambdaCms extensions come as plain Haskell packages and need to be added to the project's .cabal file like any other package dependency.

The following guide expects a newly initialized LambdaCms base application. When you have an existing base app this guide show still be easy to follow.

In the library section of your base application's .cabal file append the following line to build-depends:

                , lambdacms-media

The media extension's admin section needs to be mounted in the base app's router, therefor add the following line to your config/routes file:

/admin/media  MediaAdminSubR       MediaAdmin   getLambdaCmsMedia

To Application.hs add import LambdaCms.Media and the following line:

[...]
    let getLambdaCms = CoreAdmin
        getLambdaCmsMedia = MediaAdmin  -- add this line
        mkFoundation appConnPool = App {..}
[...]

The procede by including the migrateLambdaCmsMedia function to Application.hs as shown in this snippet:

[...]
    runLoggingT
        (runSqlPool (mapM_ runMigration [migrateAll, migrateLambdaCmsCore, migrateLambdaCmsMedia]) pool)
        (messageLoggerSource theFoundation appLogger)
[...]

To Foundation.hs also add import LambdaCms.Media and the following two lines:

[...]
    , getLambdaCms   :: CoreAdmin
    , getLambdaCmsMedia :: MediaAdmin  -- add this line
    }
[...]
    adminMenu = (defaultCoreAdminMenu CoreAdminR)
                ++ (defaultMediaAdminMenu MediaAdminR)  -- add this line
    renderLanguages _ = ["en", "nl"]
[...]

The last line hooks the media admin section into the admin menu.

Finally the following instance needs to be defined in Foundation.hs:

instance LambdaCmsMedia App where
  mediaR       = MediaAdminSubR
  staticDir y  = appStaticDir $ appSettings y
  staticRoot _ = "/static"

That's it! You can now cabal install the new dependency and run yesod devel to test drive the freshly installed extension.

License

All code in this repository is released under the MIT license, as specified in the LICENSE file.