sumeetpareek / drupal-addon-model Goto Github PK
View Code? Open in Web Editor NEWEnhancements to the Model module - https://drupal.org/project/model
License: GNU General Public License v2.0
Enhancements to the Model module - https://drupal.org/project/model
License: GNU General Public License v2.0
Introduction ------------ The Model Entities module provides a fully working yet generic example about what is good practice in creating and administering entities and integrating entities with the rest of Drupal Core and the Drupal ecosystem. It is also a way to quickstart your entities development as the code can directly be used in your own project. As mentioned the code tries to remain as generic as possible so as to not to distract away from the main issue and allow you to literally copy and paste into your own project. This module does not provide any functionality to non-developers. Installation ------------- Once you activate the module it sets up an entity administration interface under Admnistration > Structure > Model Types You can add model entities via Administration > Content > Models Keep in mind that you need to create some Model Types before you can add entities. Using the code in your projects ------------------------------- The way I envision using the module in my own projects is, for the time being, searching and replacing the word "model" with the actual name I want to give my entity and the base entity table and then adding the domain specific functionality. It would be nice if this could eventually develop in something that is automated so via a drush script we can get all the code ready to go. Customising your entities in 3 simple steps. -------------------------------------------- 1. The first step is to customize your table in module.install by adding any column tables specific to your entity. Your would only every really need to change the Model entity and Model type as ModelType is simply there to provide a means to represent your different entity bundles. Also keep in mind that if you can get away with adding data only in serialized form in the data column you can avoid doing anything to the tables. 2. You would then want to customize the edit form for your entity - which you will find in model.admin.inc and customize the behaviour of your entity on save, delete which you do via the ModelController class in model.module. Currently, I am overwriting the create function to add some extra info. If you stick to the $data variable and save extra data in serialized form (and not adding new columns to your table) - just like the model entity does with the checkbox - there is nothing else you need to do. If you have added new columns you need to add support for them in $model->create but not necessarily $model->save unless you are doing something specific. 3. Finally you can play around within the theming for your entity by looking into model.tpl.php and model-sample-data.tpl.php
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.