Development Environment

Quick word about the development environment I have chosen. The site itself is running on a Raspberry Pi 3. Superb piece of kit. Configured as a headless server, it just sits there consuming not a lot of power (around 3 Amps when working, and that includes the external hard drive) and is quite capable of running WordPress, Apache2, PHP and MySQL. At least to the level of traffic that I am expecting.

It is not, though, a development environment. For the moment I have chosen VS-2015. It is an IDE with which I am familiar, albeit predominantly in a C#/Desktop app development mode. However I am finding it extremely good for Web Development. It has good intelliSense for HTML, CSS and JavaScript, even keeping track of HTML element IDs, and Class attributes, and offering them up when working on the style sheets. Also test and debug facilities are good, allowing you to test in any Browser that is installed on your PC.

To upload to the Raspberry Pi I am using WinSCP. Brilliant little free app for moving files and directories to/from Windows/Linux. Recommend checking out their web site:  WinSCP

GIT for version control

Issues:

  1. WinSCP is great for file transfer. However it does mean that it is up to me to keep everything in Sync. Not a problem at the moment, might be later as the site grows.
  2. Some point soon, I am going to be getting into PHP and MySQL. MySQL is not be an issue with VS2015, but the PHP aspect is a whole new ball game. You can get PHP language plug-ins for VS2015, but I don’t think that extends to the Visual Studio Development Server.  Two possible solutions:
    • Install WAMP on PC and use Apache as the VS Debug Server.
    • Move over to MAC and start using Eclipse (another blast from the past for me)

Have now installed WAMP on the Laptop. I would say is that it does feel like an Add-on, but it does work well. I am able to run PHP and MySQL, test the MySQL d/b creation scripts, and fully test the site with the exception of the WordPress blog.

Do have to watch out for case sensitivity issues, both with filenames (Windows vs Linux) and with MySQL. I am used to SQL Server not only are object names (databases, tables, views, columns etc) all case insensitive but the default setting (which most people seem to retain) is that even data comparison is case insensitive.

Issues / Differences between WAMP and LAMP

  1. When constructing the template page I omitted the <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”> element. This didn’t affect the pages on the PC. On the RasPi the page was missing a  number of elements and of those that were displayed the text fonts were incorrect.
  2. Database object names are case sensitive  on Linux.

 

 

Javascript

OK – Had a quick JavaScript refresher course. The language itself was not an issue. It may have been about 15 years since my last major sojourn into JavaScript, but its a c-like language so no issues.

Did need to refresh on the DOM and other Global objects (window), plus how to integrate with media and events. I do now have a working structure for setting specific values depending on device type, orientation, browser and window size. It’s a bit clunky at the moment (too many IF statements), plus I want to better integrate CSS and JavaScript.

One interesting thing is that this is all being instigated and executed Client-Side. Not an issue with the amount of data we are downloading, but when I was last doing this kind of coding, the emphasis was very much on “Do whatever you can Server side to minimise what you download.”

Theme or Self Generation

WordPress Theme or Self Generation? That is the question. At the moment I do not have sufficient information. I have quite definite views of what I want the site to look like, and of course it has to work across all device types. I am pretty sure WordPress themes do scale nicely depending on device and orientation, and that would resolve a shortfall in my knowledge. However, I am not sure how to configure WordPress to give me the look and feel that I want, plus a part of me wants to fill in my lack of knowledge. I am also of the opinion that, before you can decide whether a third party product is up to the task, you need to know enough about the task to make a judgement.

On that basis I have decided to bite the bullet and hand-craft the site in VS2012. That will mean, at some point, working out how to integrate WordPress into a hand-crafted site, but I am sure I am not the first person to go down that route.

Actually progressed very nicely down the self generation route. I managed to get the front page and content pages responding nicely to different devices, orientations, and screen widths.  However now has come the time to integrate WordPress fully into my site. (Or perhaps it is the other way round, convert my site over to WordPress structures).

Why have I  decided to do this?  Three reasons:

  1. My blogs are obviously not part of the overall site. They look and respond differently, so I definitely need to ‘Theme’ the blogs to match the rest of the site.
  2. WordPress does an excellent job (as you would expect) of segregating Content from Layout, and whilst the mechanisms I had put in place did provide for Layout templates it did not match the separation achieved by WordPress.
  3. I could have continued down the Self Generation route and, aided by the WordPress concepts, developed my own system, but then I would still have needed to integrate the WordPress blogs. 

So I have decided to integrate and use WordPress to manage both blog and page content. 

How to go about this? Well the step is to define precisely what I want to achieve. The second step would be to the Codex to determine how I go about it.

What exactly do I want to achieve:

  1. Want the Blogs presented in Quintic Style
  2. Want Pages available from Initial Home page
  3. Want the pages constructed using WordPress – ie Content from D/B, Presentation from Templates
  4. Want the sites initial home page as is. (Need to see how WordPress deals with differing screen sizes and orientations.)

Looking into Pages.

Pages in WordPress are retained in the same structure as Posts. indeed they appear to be almost the poorer brother of Posts. The D/B table, wp_posts, holds posts, pages, images, etc. with the post_type column indicating whether the entry relates to:

  • Post
  • Page
  • Image
  • (Others…)

The wp_post table also includes the following columns which are of interest in knowing about the data retrieval:

  • post_content – The actual content for pages and posts (Not images)
  • post_title – Visible title
  • post_name – as required by url request.
  • post_mime_type – Used for images and other content
  • guid – unclear at present, looks like a url, but also has an Id, which is post_type dependent. (That is a post might have an id of say p=1 where a page would  have an id of page_id=1)

First thing I am going to do is create a page based on the index.php from the WordPress theme. This is php that loads the Posts loop.

 

 

 

 

 

 

Quintic – The purpose of this web site

Hi,

Big ambitions for first blog. The aim of this web-site is two fold.

  1. To keep a record of what I have learned and how I have used it, so that, maybe, I can give back something that I have taken from all the forums and helps sites that I have referenced.
  2. To include my thoughts and opinions on a few IT technologies

Hello world!

First piece of learning.

  1. I  have installed WordPress with MySQL (Technically Maria10) and PHP
  2. I have a WordPress blog site operational
  3. I now need to integrate it into the rest of the Quintic web site – which at present it certainly does not.

Bit of a chicken and egg situation. In order to implement the website as I want I need to learn about he exact same things that I want to post about.download The Magnificent Seven movie now

Order of learning / revision

  1. WordPress capabilities
  2. Html5
  3. css
  4. mysql & php
  5. javascript