Skip to content

A pagekit blog extensions with Categories and Tags

Notifications You must be signed in to change notification settings

martinwojtus/extension-blog

 
 

Repository files navigation

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,
  PRIMARY KEY (id),
  UNIQUE KEY pk_BLOG_POST_CATEGORY_SLUG (slug)
) ENGINE=InnoDB;
  1. Add method to your UrlProvider:
 public function getFirstURLPath()
 {
    $request = $this->router->getRequest();
    return explode('/', $request->getPathInfo())[1];
 }
  1. Go to /packages/pagekit/blog directory, and run below commands:
  • npm install
  • webpack

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 :)

About

A pagekit blog extensions with Categories and Tags

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 83.0%
  • JavaScript 15.0%
  • Vue 1.9%
  • CSS 0.1%