Forums / Cotonti / Extensions / Tutorial: A home away from home, building a blogging site - Part 1 of 3

Building a blogging framework.

MIHDev
#26910 2010-11-08 18:32
Do you have a requirement like I did where I wanted the homepage to be kept separate from lets say my blogs page?.

This article is my first in a line of several how-to's and will show you how with NO CODING EXPERIENCE you can make a blogs section and associated plugins a working reality. Over the next 3 days I will show you how to create a simple, effective and robust blogging solution using the power of Cotonti's scalable architecture.

Experience Level
Beginner - No coding experience necessary

Demo
Click here to view

Features
  • Home-page style design.
  • Blogs listing.
  • Recent blogs
Step 1: The Groundwork

The Blogs framework is based on the News and RecentItems plugins. (Copyright its respective authors).
  • Open your Plugins/ folder and copy the News and RecentItems plugins.
  • Paste the two copied folders into a new folder called BlogsFramework and rename them to Blogs and RecentBlogs respectively.
  • Open each item in each folder and rename them accordingly. EG: news.php becomes blogs.php
Step 2: Initial setup
  • Rename the blogs.php file to blogs.list.php

  • Open the file in your favourite editor and find this section
  • /* ====================
    [BEGIN_SED_EXTPLUGIN]
    Code=news
    Part=homepage
    File=news
    Hooks=index.tags
    Tags=index.tpl:{INDEX_NEWS}
    Order=10
    [END_SED_EXTPLUGIN]
    ==================== */

    Replace it with

    /* ====================
    [BEGIN_SED_EXTPLUGIN]
    Code=blogs
    Part=lists
    File=blogs.list
    Hooks=list.tags
    Tags=list.blogs.tpl:{LIST_BLOGS}
    Order=10
    [END_SED_EXTPLUGIN]
    ==================== */

  • Bring up a find/replace window (usually CTRL + R) and replace all occurences of the word 'news' with 'blogs' and all occurences of the word 'INDEX_' with the word 'LIST_'
  • Save the file

  • Open the blogs.setup.php file in your favourite editor and find this section
  • /* ====================
    [BEGIN_SED_EXTPLUGIN]
    Code=news
    Name=News

    Replace it with

    /* ====================
    [BEGIN_SED_EXTPLUGIN]
    Code=blogs
    Name=Blogs

  • Save the file
Step 3: Coming Soon.
[b]Know the question and you will be far more likely to get an answer.[/b]
This post was edited by MIHDev (2010-11-10 09:18, 13 years ago)