Written by Scott
So I've taken a bit of a break from Grav and Twig, in part because I need to reconsider a couple of things based on my designs and in part because I need to do a bit more reading on Twig before my ambition exceeds my ability and I rage quit because I can't do something I want it to do (I had that a lot with Wordpress early on, even phpBB when I used to make themes for that, so I know to take the time to read up on things now).
So I've jumped back into taking a look at STATS. Oh boy. Where to even start with this thing. I was so crudely putting it together in a rush to have it done I hadn't considered just how poorly I was putting it together. It's a database driven application that should really have at least a few classes and functions that lighten the load on the server but I haven't done ANY of that. I've got database queries left-right-and-center occasionally doing the same thing multiple times when I could just be smarter with one database call. Talk about sloppy.
The front-end design is not 100% finalised, I don't mind the colour scheme but I want to make it so users can select different colour schemes and save it as a preference. Which, to be honest, is going to require a bit of a rebuild of the whole front end so I'm going to save that for later the code is already messy enough without overhauling the layouts. I want to move to templates so I get rid of the mess of PHP files lying around. That's a problem for another time though.
The ACP is mostly functional, managing a couple of things still needs some work but this is another area I think requires a bit of a tweak to the design. Not as major here as the front-end though as there's no desire to put a bunch of different colour schemes in the ACP. You can see in the screenshot above the ACP homepage is still littered with my workings on different things. Setting user levels; generating activation codes for registering accounts; working out EPOCH times; date and time conversions; text encryption for password storage; working out special character insertion. You know, development stuff.
This is one of the more complete page layouts for locations. I've been using data from an online racing community I'm part of but don't have track maps at the moment so I made a placeholder image.
I'll have a bit more to say about this once I've had a chance to dig through and find all my sloppy mistakes. I'd start again but this would the third time of asking starting from scratch so I'm not sure I'm keen on that idea.
That's all for now,
Written by Scott
So after a bit of reading on how twig works I've started diving in and making some modifications for the theme I created in Part 1 of this series of posts. You're basically going to be seeing my build process for a new website, which I have no problem sharing because I'd love if something I do helps someone struggling with something similar.
So the first point to check off was to get a header working. I had a static page I had been working up for my new personal website that I've decided to use as my test bed for this process. This is going to be an interesting challenge because I'd planned to have a landing page which is separate from the normal homepage. Let's see how that works out but I've got a plan in case it doesn't go the way I think.
So here's the static version I was aiming to port over.
And here's the same code section incorporated into Grav.
I'm not showing any screenshots of the end result just yet, not ready to show anything off at this stage. So far so good though. Time to start working on the actual content section and see what kind of magic can happen there with different templates!
Bye for now.
Written by Scott
It's been a little while since my last post. There's a couple of reasons for that, I was sick during last week just after unplugging all my gear to rearrange things after painting. So not only was I sick, but all my gear was disconnected and I had no energy to plug it back in again. I've only just managed to get to the point of having the essentials plugged back in to post this.
The new lick of paint has come up better than I thought, the new colours work really well together. Now I just to need to get all my artworks and shelving back up on the walls (covering the newly minted paint...) and go through all the crap I moved out of here and get rid of stuff I no longer need or want because I've got too much stuff.
We've been going through some scope approval stuff at work so I haven't had time to look into more Grav things lately. That process is winding up soon though so I should be able to put some time back into it at the start of September. And don't think that I've forgotten about STATS. The minds been working on some ideas for that.
That's all for now. :)
Written by Scott
So I've been messing around with Grav for a few days now and believe I'm at a point I can start talking about where I thought I'd hit a wall but ended up finding a pretty easy workaround that made me feel like a bit of an idiot.
Firstly I should point out that Grav's Documentation is more than enough to get anyone going, the important thing is actually reading it and understanding everything. That's going to be the next challenge now I'm over the initial hurdle of getting themes up and running. Chapter 3 is where I've been hanging out most of the time I've been looking into it (when I haven't been just poking around the Admin Panel getting a feel for it). Having a read of the Twig info is actually helping me get my head around how that actually works, and I'm quite keen to see if I can things working for my new personal website how I want them to with what Twig and it's functions is looking like it's capable of.
First things first though, I had to get a theme up and running. So I followed the instructions on this page to get me started. This was where I hit my first hurdle. I could get DevTools installed through the ACP no problem, but how was I going to access the CLI? I could work it in for CMD Prompt to use PHP. Initially I abandoned the idea and just duplicated the Quark theme and started plugging away modifying stuff to my liking. But the more I thought about it the more I knew I wanted to know the whole process. So I came back to it and looked a bit further into it.
This is where the "ending up feeling like an idiot" comes into play. As I'm using Laragon for my local development environment the program comes preconfigured with a terminal emulator called Cmder, Linux/GNU based commands come at me! How I didn't think of that before was beyond me but now we're cooking with gas! Very important to note that the commands still need to be written with php leading the command, so what the documentation says, but with php in front (prepend? Is it prepend as the opposite of append?) to actually make it work. Like this:
λ php bin/gpm install devtools
You'll see in my screengrab below that I had a bit of trial and error before I figured that out. Then I went through the steps described in the documentation to create the new theme:
Everything has come up roses, the new theme works nicely so now I can move on to the HTML and CSS and working out how Twig works with it. Fun times ahead!
Written by Scott
So I mentioned in my last post about getting a few CMS's together and working on drilling down on seeing how they work and getting into developing for them. I'm happy with my list at this point and think that I'll be looking at the following systems in the following order:
- Grav - As far as flat-file CMS's go, it was out of Grav or Bolt. Bolt seems nice so given they both use Twig for templating it's highly likely I may look into Bolt at some point in the future as well. I just liked the look of Grav and I'm pretty sure I found it before Bolt so it had the running lead and became first pick.
- ForkCMS - For something to move into a CMS that isn't Wordpress (which I've excluded from this list because I've got a fairly good idea already for styling and developing for it) I've chosen Fork. It seems like it's straight forward for non-developers to use, which is an important consideration when working with people who just want to be able to build pages or post news without having to jump through hoops or complex interfaces. Some other options here were Concrete5 or ModX. I'd used ModX once before and didn't like it that much at the time, that was quite a few years ago now so it's probably changed a fair bit (or at least my perception on things probably will have). Concrete5 is another option I'd probably look at down the line similar to Bolt/Grav.
- Typo3 - I'd be a long way off learning this one, but for enterprise-level solutions Typo3 seems like a powerful option. It looks complicated from an administrative standpoint though so I'm guessing this would be more of a personal exploration project, at least initially, before I consider doing anything with it.
So I've got Grav for small-scale websites, ones that may be updated occasionally with new content and pages but not so heavily to require a database or complex ACP. Fork for medium-scale, where a database for managing pages, posts and media would be useful for site admins, but not overly complicated in terms of functionality and permissions to actually use the site. And Typo3 for eventual large-scale projects, the kind that would probably need more than one developer to be honest, which is why it's so far down my list on things to learn.
The advantage is that they all use Twig, so learning that will at least be a transferable skill to the others - short of system-specific elements - to cut down a bit on adapting to the new system.
I'm starting with Grav as I'm looking at using that for my new website. Like I said, Wordpress hasn't been the greatest choice for something so basic. A combination of Grav and this blog should be more than suitable to do everything I need. I thought about starting with Fork, but from a usability standpoint it's very similar to the new system we're going to be using at work so I've got no dramas leaving that for a bit so I don't confuse myself between the two.
In the interim I'm in the market for some new screens so I'm looking at ones that will be good for developing with. I was going to go 1440p so I could get high refresh rates for gaming, but I'm increasingly realising that I do more development than gaming so I'm prepared to sacrifice refresh rate and bump up to 4K for more screen real estate. More on that another time though.
That's all for now, see you in the next one,