Форуми / Cotonti / Extensions / Tutorial: A home away from home, building a blogging site - Part 1 of 3

Building a blogging framework.

MIHDev
#1 08.11.2010 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]

Відредаговано: MIHDev (10.11.2010 09:18, 13 років тому)
Kingsley
#2 08.11.2010 23:20
:) this I will follow...
Kort
#3 08.11.2010 23:28
CCCDev I think before posting this you have to review the news plugin capabilities.
SED.by - создание сайтов, разработка плагинов и тем для Котонти
MIHDev
#4 09.11.2010 01:27
Hi Kort,

That is a fair point, however the idea behind this set of tutorials is to take it to the next level and day by day build and eventually have a fully-fledged plugin for Blogs which the users can create and modify as well as choose how they want their blogs displayed from a set list of customisable templates.

It also allows the users to customise the look and feel of their blogs rather than a specific-structured approach which news.cat templates give.

This approach is more based around novice\new developer users who do not have many years of coding experience and would like to understand and learn how the plugin and skin architecture works in a simple way and also how easy it is to extend existing plugins, thus they gain knowledge of the internals rather than just the externals.
[b]Know the question and you will be far more likely to get an answer.[/b]
Kort
#5 09.11.2010 03:11
It's good to build such a tutorial so that future Cotonti users could have a step-by-step blog building guide. I just do not understand what is wrong with the news plugin and why it should be renamed. Cotonti has all (well, most) facilities required to build a blog out of the box. What is missing here is "recent items by cat" which is basically a plugin that can be easily developed and added to the downloads. Issue of Cotonti as a blogging platform is a long-lasting discussion, and some things (like tags support in the news plugin) are added occasionally to the core to make the blog-building task easier. There are still some features missing (like tags in list items), so rather than misleading users we should identify the key blog features and discuss ways to implement them in the core or plugins.
SED.by - создание сайтов, разработка плагинов и тем для Котонти
MIHDev
#6 09.11.2010 05:01
Hi Kort,

As always your feedback is useful and taken on board and I will ensure I document my advanced blog topics for the next team discussions.

My intent is not to reinvent the wheel or redesign the system in any way. It is purely to help users better understand it without potentitally damaging their sites News plugins. This is a simple way to offset RISK without breaking running sites.

This tutorial is designed to be a helpful introduction to how scalabe CMS architectures work and how seemingly complex tasks can actually be simple to implement without a vast knowledge of code or development.

My life revolves around helping others and remembering that sometimes people are just getting started and are not experienced developers and\or do not want to be developers. (There is nothing wrong with either). We all started somewhere and for me tutorials were a life-saver.

Thank you for your feedback :)
[b]Know the question and you will be far more likely to get an answer.[/b]

Відредаговано: MIHDev (09.11.2010 05:52, 13 років тому)