Download the PHP package netcore/module-content without Composer

On this page you can find all versions of the php package netcore/module-content. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package module-content

Content management with widgets v2.1

Idea behind this package is that many webpages are constructed from different sections, that look different in frontend, but they can use identical UI and database structure in backend. For example, a typical landing page might consist from following sections:

  1. Large slider with images. Each image has large title and smaller subtitle.
  2. A grid of services provided by webpage. Each item in grid has image, title and subtitle.
  3. Testimonials. Each item has image, person's name, and content.
  4. Brands. Each item has image and link to external website.
  5. Employees. Each item has image, name, position, age and link to Linkedin.

We call these sections "widgets". Each of these look very different in frontend, but backend can be made universal. That's because we typically need the same fields over and over again - image, title, subtitle, content. Any not so common fields, like links, buttons or other non-standard information is stored in a JSON format.

In order to add a new widget to your page, you would perform only the following actions:

  1. Seed new widget in database
  2. Create custom frontend template file for that widget

And that's it! Backend will be generated automatically. You can reorder, edit, and add new widgets to pages. Screenshot:

screenshot

Pre-installation

This package is part of Netcore CMS ecosystem and is only functional in a project that has following packages installed:

  1. https://github.com/netcore/netcore
  2. https://github.com/netcore/module-admin
  3. https://github.com/netcore/module-translate

Installation

Require this package with composer:

composer require netcore/module-content:2.1.*

Publish config, assets, migrations. Migrate and seed:

php artisan module:publish-config Content
php artisan module:publish Content
php artisan module:publish-migration Content
php artisan migrate
php artisan module:seed Content

Package also comes with basic ResolverController.php and routes for showing static pages and channels. It will work for many simple pages. If you need something more sophisticated or custom, you will need to implement your own Resolver. However, in most cases add this to your RouteServiceProvider.php (typically in method:

Route::group([
    'middleware' => ['web'],
    'namespace'  => null,
], function (Router $router) {
    \Modules\Content\Http\ResolverRouter::register($router);
});

After installation, you should config file.

Updating to new version

Let's imagine you have installed version v2.1.0, but a couple of days later v2.1.1 is released. Because we are working with https://github.com/nWidart/laravel-modules, simply doing might not be enough, because there might be changes in assets and/or migrations. Therefore, to install new version, you should run all the following commands:

composer update netcore/module-content
php artisan module:publish Content
php artisan module:publish-migration Content
php artisan migrate

Terminology

Before working with this package, it can be helpful to understand basic terminology:

  1. Entry - this is a page. It can be either a standalone page like "Terms and services", or it can belong to a channel. For example - page "Post 1" in "Blog" channel.
  2. Channel - this is a group of entries. Common examples of channels are "Blog", "News", "Reports".
  3. Section - sections are currently not used anywhere and will be deleted in version 0.1.x
  4. Widget - some sort of section that exists in page. Common examples are LargeSliderWidget, TestimonialsWidget, EmployeesWidget.

It is better to keep everything in separated seed files, because it can get messy after some time. We recommend to create WidgetSeeder, ChannelSeeder, PageSeeder

Adding a new widget

  1. Start with widget seeding

Widget fields are meant for widget main information. For example, title. Item fields are meant for items which will be stored in widget. You can store multiple items in one widget. You can customize widget options, available options:

You can create empty widget, which won't be configurable from Content section in admin panel, but you can display any data in frontend template. This is useful if you want to display forum thread list. Here is an example widget:

  1. In most cases you will want to customize name, key, frontend_template, javascript_key, backend_worker and fields. However, in most cases your will not customize backend_template and backend_worker. These are usually universal.
  2. Create template that you specified as in step one.
  3. All done. Backend is generated automatically.

Creating pages and seeding widget content

You can seed multiple pages per channel. By default there is always default channel (Main) which contains static pages, but there is cases where you would want to create another channel for News.

Below there is an example for seeding pages per channel

$homepageData looks like

Adding a new channel

If you want to create new channels, for example, you may want to create news channel where you would store news articles.

However, you need to configure and create a template for each of your channels in

Template file looks like this

Main information about versions

0.1 branch contains initial version of package. It has very limited multi-language support and it is mainly intended for use in not-translatable websites.

1.0 properly supports translatable websites. SimpleText and ImageBlocks widgets are deleted in favor of more universal WidgetBlock widget. Additionally, fields for widget items are no longer stored as JSON.

2.0 TODO


All versions of module-content with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
dimsav/laravel-translatable Version ^9.0
yajra/laravel-datatables-oracle Version ~8.0
intervention/image Version ~2.4
codesleeve/laravel-stapler Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package netcore/module-content contains the following files

Loading the files please wait ....