chiraggude / larabase

Not actively developed. Base app to kickstart Laravel 4.2.x projects. LaraBase is a lightweight foundation for building apps with inbuilt Authentication, Blog, Bootstrap and other swappable components. The codebase is optimized for readability and to give you a great headstart for your projects. The codebase is by no means "pure" or "optimized".

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request: Categories/Subcategories for Blog posts

connecteev opened this issue · comments

Hi,

Love the elegance of larabase so far. I would love to see nested categories (categories and subcategories) in the blog, both for "clean" URLs for the end-user, and for SEO. Most blogs have this feature these days.

Details:

  • Categorizing Posts: When adding / editing a blog post, you can select the category (or sub-category) the post belongs to. (Ideally, a blog post can belong to multiple sub-categories, with a "default" subcategory tree. The blog URL would be based on the default sub-category tree.)
  • The front-end (blog URL) would use: /{category1}/{sub-category2}/{sub-sub-category3}/article1.htm
    Example: /getting-pregnant/trying-to-conceive/article1.htm /getting-pregnant/trying-to-conceive/article2.htm
    Optional / Advanced feature: The Back end could allow the admin to select URLs that are either flat, or nested. If 'flat' is selected for the URL structure, the front-end for the 3 examples above would have URLs like: /trying-to-conceive/article1.htm /trying-to-conceive/article2.htm In general: /{sub-sub-category3}/article1.htm
  • Managing Categories: A page in the admin lets you manage categories / subcategories...a hierarchical list of categories (so, you can add sub-categories to the tree). Nice to have: You can drag/drop categories and subcategories anywhere in the tree.
    (Step #3 is nice to haves a workaround, the admin could add the categories and subcategories to the database table directly)

The schema and sample data for categories would look something like this:
CREATE TABLE categories ( id int(10) unsigned NOT NULL AUTO_INCREMENT, id_parent int(10) unsigned DEFAULT NULL, name varchar(63) COLLATE utf8_unicode_ci NOT NULL, url varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, is_featured tinyint(1) NOT NULL DEFAULT '0', is_active tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=132 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Hope this isn't too much information :) This would definitely push the project forward.

Best,
Kunal

Closing this issue as blog posts can be categorized and tagged.

Dont think they can be added to multiple categories..