Blog Posts implemented in docrootCMS

sstacha@gmail.com • > a year ago

While I have had the docroot cms available and being used for quite some time it really didn't have any way to dynamically handle blog content built in. This is arguably one of the most used ways to get dynamic content on website pages. Developers could always create forms for content people to fill out using models and tying into the admin but there was nothing that developers or content creators could leverage from the start. Developers and content creators can now utilize the blog capability of the cms by creating markdown posts and categorizing them.

The following is a quick 5 min tutorial to follow to learn how to use the blog functionality.

Create a new post

Create a new post by going to /admin/. If you are using my instructions on github you can use this link: http://localhost:8000/admin/. NOTE: in order to log in you will need to create a superuser account for now. This can be done by executing

python manage.py createsuperuser

from your project directory (the directory containing manage.py) and following the prompts. Once logged in click on Markdown Post and create a new post. Give it a teaser and some content. The preview below should show what this will look like if you are using bootstrap4 in your views.

View blog listing

Once saved you should be able to go to http://localhost:8000/blog/ to see a listing containing all active posts ordered by most recent first.

View blog detail

Clicking one of the teasers will send you to the detail.

More about markdown features available

There is a very good reference sheet located at the bottom of the preview pointing https://commonmark.org/help/. Although, just about any markdown reference should do since it is a standard. Some advanced features may not be supported see Markdown on pypi for a list of supported features. By default extended features have been enabled for you.

A note about CSS

You may notice that CSS may look very different on the website view pages than the admin screen. This will be something that will be worked on going forward, however, you can always inspect the admin page with developer tools and add the CSS to your page templates to get it looking correctly until I can get to it.

Tutorials

My video blog will be the next thing I take on once I get the website fundamentals back up. I intend to make a Training section that will have short 15min videos on everything from installing to using my available products.