Techno Spot

I have a love of technology and I'd like to write about various things I find fascinating that relate to technology here. This is separate from the blog because the content will probably differ considerably and I think technology deserves its own highlight.

Site UI Backend and Simple CMS

Along with the UI changes that I made fairly recently, there were also some important changes made to the way the site is put together. These changes make the site a little more easy to maintain, and a lot more user friendly. Besides this, I have also been working on (read: starting to work on working on) a very simple Content Management System. Basically an interface that would allow users to generate pages of sites without having to get into the meat of it.

Dynamically generating content, kind of

The changes I made to how this site is designed has to do with the sidebar over here on the right side of the page. This element is actually dynamically created when each of the different blog-type pages are loaded. A function is called when the main .php file is accessed. This function looks through the directory where the blogs for the page are stored and pulls the titles of the five most recent posts and then inserts them into the bar along with a link to that section of the page. There were a few challenges involved in this, but they mostly had to deal with regular expressions and trying to get the title and link to an anchor out of the files themselves. If you would like to look at the code for this, a gist can be found here.

Overall, I'm pretty proud of this improvement. I think the UI change itself makes the site look more polished alone, but I'm particularly fond of what this change accomplishes. It might be a rather simple fix, but it makes the site much easier to maintain by making sure I don't have to update the code for this small section of the page each time I write a new post (which hopefully should lead to me writing more posts...maybe). Actually a big impetus for doing this was an XKCD comic I saw that was criticizing infinite scrolling pages, something I realized my blogs were quickly becoming. Now the older blogs are neatly tucked away in an archive page, which does still happen to be an infinite scrolling page. Next I would like to find a way to fix this and get each post to have its own page (I have an inkling of a solution, but I need to let it ferment).

Clearly not the way to do things.

Dead-Simple CMS

As for the other project, I have actually started to do some work on it. Obviously things are still in the early stages of development, but some things are starting to come together. For instance, some templates have been created. They are ultra-simple right now, but the hardest or most important part isn't even designing a template, but rather finding a way to make use of templates. Once this is settled, then it's pretty easy to design all kinds of templates and implement their use into the system. So what you will see over on the Git repository if you want to take a look is a very simple two-template scheme, consisting of a "Welcome" and "Blog" template, but these are really just placeholders to make sure that the page creation logic can adequately identify and apply a theme selected by the user. I think that this "template" system could actually be used to help with the problem I listed above with my archives being infinite scroll pages, at least that's what I'm looking at right now to work through the issue.

The other important section that has been implemented is a simple administration page that allows users to generate a page of content by entering in all of the necessary information into designated text fields and then simply hitting submit. This is also in the pretty early stages of development as the user is still required to write the page's actual content using HTML to insure proper formatting. One of the next things to do would be to create a PHP function that parses the text given in the content field and translates it into valid HTML code for use by the browser. Some aspects of this are more difficult than others. For instance, making sure each paragraph is enclosed in <p> tags is fairly trivial, but making it so that users can embed photos or other media into a page without entering the proper HTML is a more challenging issue.

Concluding remarks

Staying productive seems to make me much happier than when I am just sitting around watching Netflix, and I'm glad that I have a few different things to work on right now. Besides the things above, I have been working on a few more minor changes to this site, like adding an awesome, working contact form which you should use and fixing a minor UI flaw in the CSS that made pages display improperly on large screens. I have also been applying to jobs recently, mostly looking for stuff to do with either web design, programming, or both. I've been able to find positions that definitely seem like something I would like to do, but because of my time left here in Europe I'm worried that I could miss out on potential jobs that employers want to fill right away. This is unfortunate, but hopefully it won't affect too much in the long run and I'll still be able to find a good position somewhere.

Anyway, thanks for reading!

-- MM 06-05-2014

All archived posts