Coder Social home page Coder Social logo

martynassateika / fuel-cms-translatable-module Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 222 KB

A module for the FUEL CMS content management system that allows setting up translatable fields in models.

License: Apache License 2.0

CSS 1.08% JavaScript 1.78% PHP 96.47% Hack 0.68%
fuel-cms translation-management

fuel-cms-translatable-module's Introduction

FUEL CMS Translatable Module

The Translatable Module is a module for the FUEL CMS content management system that allows setting up translatable fields for existing models.

GitHub Logo

Installation

There are a couple ways to install the module. If you are using GIT you can use the following method to create a submodule:

Using Git

  1. Open up a Terminal window, "cd" to your FUEL CMS installation then type in: php index.php fuel/installer/add_git_submodule git://github.com/martynassateika/FUEL-CMS-Translatable-Module.git translatable

  2. Then to install, type in: php index.php fuel/installer/install translatable

Manual

  1. Download the zip file from GitHub: https://github.com/martynassateika/FUEL-CMS-Translatable-Module

  2. Create a "translatable" folder in fuel/modules/ and place the contents of the tester module folder in there.

  3. Then to install, open up a Terminal window, "cd" to your FUEL CMS installation and type in: php index.php fuel/installer/install translatable

Uninstall

To uninstall the module which will remove any permissions and database information: php index.php fuel/installer/uninstall translatable

Troubleshooting

  1. You may need to put in your full path to the "php" interpreter when using the terminal.
  2. You must have access to an internet connection to install using GIT.

Attributions

Licence

The Translatable module for FUEL CMS is licenced under Apache 2.

fuel-cms-translatable-module's People

Contributors

martynassateika avatar

Watchers

 avatar

Forkers

tomzdulski

fuel-cms-translatable-module's Issues

Call to undefined function starts_with()

The following exception is thrown when trying to save a Translatable_item.

An uncaught Exception was encountered

Type: Error

Message: Call to undefined function starts_with()

Filename: C:\xampp\htdocs\FUEL-CMS\fuel\modules\translatable\models\Translatable_item_model.php

Line Number: 177

Add ability to set field type for translations

Because translations are currently stored as longtext in the database, FUEL CMS renders them in WISIWYG-type textareas.

This is not ideal as often users might want to translate simple strings that should be single-line, and without any HTML tags etc. The module should allow developers to choose whether they want to associate a Translatable_item with an input field or a textarea.

Solution 1

One way to do this is by having two pairs of tables, one for translatables/translations of single-line strings, one for multi-line WISIWYG input. It's quite clunky though, and the type of field used to render the translation in the CMS shouldn't impact table sctructure this much.

Solution 2

The other option is to allow developers to set the type of field to use in the form_fields method in models that have links to Translatable_item. Say you have a model Gallery_model with a translatable gallery_title field you want to render in a simple text field. The code would look something like this:

$fields['gallery_title']['translation_field_type'] = 'text';

This most likely means setting up some custom FUEL CMS field type, something I haven't yet looked at.

Another issue to tackle is the fact that in version 0.1 users could simply hop over to the Translatable items model in the CMS and alter the translations however they see fit as the Translatable_item_model on its own would not know how to render the translation fields.

I am tempted to simply hide access to the Translatable_item_model and Translatable_item_translation_model in the CMS and make adding / editing them possible only by editing other models.

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.