User Tools

Site Tools


blogging

Blogging with Wizard's Toolkit

This is not a full-featured blog but will provide all the basics and does not require installing WordPress or any other libraries. Current version does not allow the public to add Comments but that enhancement will be added later. Wizard's Toolkit is a low code development library and this code stores your data in `wtkBlog` data table. You can start with this code and data and modify it for your own needs.

There are three parts to the WTK Blog Management.

  1. Blog Designer
  2. Blog Writer
  3. Blog Viewer

Blog Designer

This page helps the developer design the look-and-feel of the blog. From this page you do all of the following:

  • pick colors
  • pick default font

It saves the choices into a blog.css file. The Blog Designer is located at: /blog/admin/Designer.php and since it does not read nor affect data it does not require any security level to access. Of course you have full access to the source code and can change as-needed.

If you want to adjust the width of the side navigation column or change the color of text in the footer, you can do that easily by manually editing the /blog/files/blog.css file.

Main Files Used

  • /blog/admin/Designer.php
  • /blog/admin/ajxSaveCSS.php
  • /blog/files/blog.htm
  • /blog/files/blog.css

The blog.htm and blog.css are intuitive and although the logo you define in wtk/wtkServerInfo.php is automatically used for your Blog logo, you can easily change it and set your blog header by hand-editing blog.htm.

Blog Writer

For the blog writer, they should start in your /blog/admin/ folder. This calls the index.php file which shows a list of the blogs you have written or are working on. From this list you can view the blog to see how it will look to the public or you can add/edit a blog.

Part of the creation of a blog is choosing the Slug and meta tag values. The “slug” is the text which will be appended to the end of the URL to improve SEO. For example if you had an article about “Feeding Carrots to Dogs” the URL would be better on SEO if it was https://yourdomain.com/blog/feeding-carrots-to-dogs rather than https://yourdomain.com/blogs/?id=42

Included in Wizard's Toolkit in the /blog/ folder is an .htaccess which handles the slug aspect for you. It converts the query string into a parameter which is passed to /blog/blog.php as the slug parameter.

Summernote WYSIWYG

When writing the blog the Writer.php page uses the Summernote WYSIWYG editor. We are using the “Without Bootstrap (lite)” version. This makes it easy to format your text similar to a word processor but using HTML. There is a </> button which allows you to see and edit the actual HTML code also. If you are copy/pasting from another website or document Summernote will often automatically generate or copy the HTML formatting but you should then check the underlying code since some programs have horrible HTML. For example Microsoft Word has very bloated HTML and it is generally better to copy/paste into a simple text file so that HTML is not copied over and then to use Summernote for your formatting.

Images

The default Summernote image upload stores the images as base64 data but that bloats the database and slows down uploads and is generally a bad methodology. Wizard's Toolkit uses JavaScript coding to change the image functionality so it uploads the image to the /blog/imgs/ folder. This makes for much faster page loads and a better blog-writing environment.

Currently if you delete the image from the blog it is not deleting the image from the /blog/imgs/ folder and that needs to be done manually. Later we will be adding enhancements for this.

Main Files Used

  • /blog/admin/Writer.php
  • /blog/admin/ajxUploadImg.php
  • /blog/files/blog.htm
  • /blog/files/blog.css
  • /blog/files/blog.js

So images can be uploaded you need to have a imgs subfolder in the /blogs/ folder.

Blog Viewer

Since this is for the public (in most cases), the blog viewer is the /blog/ folder of your domain. If no value is passed by default it will show the most recently written Blog and the side navigation will allow jumping to any of the prior blogs.

Note that until you set the “Make Public” toggle to “Yes” on the Blog Writer page, the blog will not be visible to the public. It will be visible to you if you click to view it from the /blog/admin/ page since it checks to see the referer and allows viewing if called from that page.

Links to prior blogs uses the slug of the blog which makes the SEO better. All of the code for this is handled in /blog/blog.php. The PHP is easily modified if you want to change the side navigation or any other aspects.

Main Files Used

  • /blog/blog.php
  • /blog/.htaccess
  • /blog/files/blog.htm
  • /blog/files/blog.css
  • /blog/files/blog.js
blogging.txt · Last modified: 2022/04/15 15:05 by wtkadmin