A pagekit blog extensions with Categories and Tags
Clone or download
Pull request Compare This branch is 3 commits ahead, 2 commits behind martinwojtus:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
assets/css
languages
src
views
.gitignore
CHANGELOG.md
DDL.sql
README.md
category-form.png
composer.json
icon.svg
index.php
package.json
post-edit-form.png
scripts.php
webpack.config.js

README.md

Blog Extension

This extension has implemented Categories and Tags in a very simple way. If you want to check how this extension work just go to: http://frontbackend.com

It allows you to change post url from /blog/post-url to /category-name/post-url.

Installation

  1. Download extension

a) when you don't have blog extension:

b) when you already have blog extension:

ALTER TABLE pk_blog_post ADD tag1 VARCHAR(100);
ALTER TABLE pk_blog_post ADD tag2 VARCHAR(100);
ALTER TABLE pk_blog_post ADD tag3 VARCHAR(100);
ALTER TABLE pk_blog_post ADD tag4 VARCHAR(100);
ALTER TABLE pk_blog_post ADD tag5 VARCHAR(100);
ALTER TABLE pk_blog_post ADD tag6 VARCHAR(100);
ALTER TABLE pk_blog_post ADD tag7 VARCHAR(100);
ALTER TABLE pk_blog_post ADD tag8 VARCHAR(100);
ALTER TABLE pk_blog_post ADD tag9 VARCHAR(100);
ALTER TABLE pk_blog_post ADD tag10 VARCHAR(100);

ALTER TABLE pk_blog_post ADD category_id int(10) unsigned NOT NULL;

CREATE TABLE pk_blog_category (
  id int(10) unsigned NOT NULL AUTO_INCREMENT,
  title varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  slug varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  color varchar(7) COLLATE utf8_unicode_ci NOT NULL,
  icon varchar(30) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (id),
  UNIQUE KEY pk_BLOG_POST_CATEGORY_SLUG (slug)
) ENGINE=InnoDB;
  1. Add method to your UrlProvider (app\modules\application\src\Application\UrlProvider.php):
 public function getFirstURLPath()
 {
    $request = $this->router->getRequest();
    return explode('/', $request->getPathInfo())[1];
 }
  1. Use node.js & webpack to create the JavaScript files under blog\app\bundle

In your administration panel you will see new Categories tab, with list of stored categories.

Edit category form: Category Form

Edit post form: Post Form

Use at your own risk :)