(b)log-insert imagen

13/01/2021

2021/01/13#p1
# Click to read or leave comments

How time flies!

It was a week ago today that I launched the new blog and I couldn't be happier with how it's performed so far.

Ive been thinking about adding a drafts feature but need to work out exactly how it would work. I'm envisaging a system whereby when logged in I can see everything but only live posts when not. I'd need to add an additional column to the database and perform different queries. What I haven't decided is whether they would appear among the live posts based on time created or as a separate query underneath. I would also need to change the timestamp when they are made live.

I'm going to think about this a bit more and maybe have a look at implementation over the weekend.

Draft:   Publish:
Leave a reply



Cancel comment
2021/01/13#p2
# Click to read or leave comments

It's the weekend already isn't it? No? Oh well, never mind.

The first stages of the drafts feature is in place. This post was initially saved as a draft so wasn't visible when not logged in. I'm now changing its status after another edit so it should go live.

I just realised I forgot to add the check to the live feed so the post went out by accident.

Draft:   Publish:
Leave a reply



Cancel comment
2021/01/13#p3
# Click to read or leave comments

And here is how a draft will look (to me) on the page:

Test Draft

Draft:   Publish:
Leave a reply



Cancel comment
2021/01/13#p5
# Click to read or leave comments

Everything should now be in place for the drafts functionality. Famous last words. Publishing an existing draft will now recalculate the section number, post time and date, removing it from its placeholder position and inserting it in the correct place.

Draft:   Publish:
Leave a reply



Cancel comment
Colin Walker
COLOPHON | Content: CC BY-NC 2.0 UK
Colin Walker Colin Walker colin@colinwalker.blog