Top Posts of 2014

This is Day 7 of 10 Days to a Better Blog (I took Sunday off so I’m a day behind!)

Day 7 of this Better Blog progression is looking at our top posts for the past year.  I’m a bit late to the ball game on this post, but here are my tops posts for 2014 and some additional thoughts on them.

1 – SQL Schema to CodeIgniter DBForge – This one really surprises me as this was something that I did based off of some contract work and something that I needed.  I’ve used it a little bit here and there myself, but didn’t think anyone else would use it.  Additionally I’m sure it would be coded a lot better by someone else.  I’m glad to see that it’s being used by others!

2 – 3 CMS’s: WordPress, Expression Engine and PyroCMS (the 100,000 foot view) – This post was written in January of 2013.  At the time it received some traffic to it and I’m still amazed that it shows up as a more popular one.  Having said that I’ve been tempted to take down all of my posts regarding PyroCMS as I believe so much has changed on the product that these posts are not useful.  I know at least the ownership has changed for reason’s I’m not privy to and they are getting close to moving it 100% to Laravel.

3 – Goodbye PyroCMS, Hello WordPress (the real #3 is the link to the migrate script referred to in the #1 post, but since it’s not a post I’m not including it!)  – Once again a PyroCMS post.  I think this is because beyond the website for PyroCMS there are no other resources for the CMS.  I know some people had talked about doing a community based website but I don’t think anything came of that.

So there are 2 posts related to PyroCMS which I will not be writing more about.  The one post that is remotely something I could write about is the CodeIgniter DBForge utility that I wrote.  CodeIgniter appears to have some new life in it, and I still use it for most of my projects, but I’ve been hesitant to jump into writing about CodeIgniter because (a) I’m not sure if it does really have life back in it (may have missed the boat with Ellislabs doing nothing with it for so long (b) there are people that know the CodeIgniter framework a hell of a lot better than myself.  On the flip side another voice might be what’s needed in that realm (I think a lot of people who had been doing something with CodeIgniter, have moved onto other pursuits).

Installing Vagrant on Windows – Stalling on HyperV message

I finally got Vagrant working on my work computer, which in turn will hopefully make my development life a lot easier. At a minimum it should remove my need for having a separate development Ubuntu machine! However it wasn’t without it’s hurdles.

Every time I tried to do ‘vagrant up’ it kept stalling on a message about installing HyperV, which was not what I was trying to bring up.  I was trying to bring up a Ubuntu machine.  I did get it solved and here’s how I did it.

  • Uninstall Vagrant
  • ReInstall Vagrant
  • In a CMD prompt (probably best to run this as administrator) I ran ‘vagrant box add precise64 http://files.vagrantup.com/precies64.box
  • Run ‘vagrant init precise 64
  • Run ‘vagrant up

That should get your machine up and running.  Except for the first two steps, it’s all done in a CMD/DOS Prompt.  In order to do the ‘vagrant ssh‘ step that many guides have you’ll need to do that from a Git Bash prompt.

Here’s a few links that I found rather helpful in this process:

Getting Started with Vagrant on Windows 7 and 8

Vagrant and Apache

 

Lesson’s learned from updating a newspaper website design

At least 7 years.  That’s at least how old the previous design was.  It’s probably older than that, but it’s been here since I started working at the newspaper that long ago.  So it was time.

The process began last October (2013).  It’s still on going , but it’s March of 2014.  Here’s a few things that I’ve learned.

  • Don’t move my cheese!  With a 7 year old site people got used to where things were placed on the site.  They don’t like them being moved and you’ll hear about it.
  • 7 year old web sites have a lot of stuff on them and it’s going to take a LONG time to get everything updated to the new design.  I’d add a caveat that if you have a decent CMS and have planned ahead (thought ahead) it may not be as bad (or if you use a bunch of includes…).  If not, have fun.
  • For reason #1, above, have a thick skin.  Even though you know all of the technical reason’s why the site needed to be updated, the non-technical person won’t care.  They just want it to work and to be where it was before.
  • Don’t let your site get 7 years old. Even if it’s only a matter of updating the technology and moving a few things around, don’t let it get that old.  I’d say two to three years is enough. At that point things will have changed and you need to upgrade.  I think at this rate not to many things will have built up and you can upgrade without to many complications.

Lastly, if you find yourself in this situation take your time. Don’t rush anything.  Make sure management is behind you.  There will be things you haven’t planned for, but you’ll get it done.

Goodbye PyroCMS, Hello WordPress

As some may have noticed I haven’t posted much about PyroCMS in awhile.  Perhaps some have asked why that is.  Well here is the post explaining that.  I’ve gone back and forth on if I should write this, but I feel like I should for anyone who may have came here for thoughts on PyroCMS.

I had made pretty good progress on my modules for PyroCMS (for those catching up I was working on moving our newspaper site over to Pyro).  I had articles imported into the system.  They were categorized.  I was able to pull in photos and I had even got the front end working (not complete but pretty good).  It was going well.  And then I tried to figure out how to get slugs working (slugs being what creates your URL so it’s SEO friendly).  And I proceeded to bang my head against the wall.  This went on for a few days.  I checked the forum, I checked the ‘secret’ Facebook page and I hung out on the mostly silent IRC group.  While some answered my questions many were just as confused as I was.  I eventually emailed Phil and asked him what the community could do to help.  I had found the documentation was severely lacking and I thought it would help move the project along.  In typical fashion he promptly replied to me about it (which is awesome).  Phil’s response was documentation sucks (it does) and to submit requests for more information.  Not due to Phil’s response but just due to the over all banging of my head against a wall I took a pause on my PyroCMS project.  Well the pause became a goodbye when I started working with WordPress.

In a lot less time I was able to get my content into WordPress, with slugs (it’s automatic if you use the API) and I’ve pretty much got a template up and running.

Is that to say that it’s better than PyroCMS?  Nope.  I have some worries about using WordPress, security being a pretty big one (and the speed), but for the time I have to dedicate to this project WordPress currently appears to be the best choice for me.  The documentation far surpasses what PyroCMS has.  At lot of that has to do with (1) the amount of people working on WordPress and (2) the amount of time it’s been around (it has been frustrating at times as well but eventually I’ll find what I’m looking for). Both of those are things that PyroCMS can overcome in due time.

So what I’m saying.  If you have the time and the will to learn PyroCMS, I think it’s a great thing to learn.  It’s growing and the community is mostly developers which I think is a strength but also a weakness (see documentation).  Support and documentation can be pretty spotty in places.  Wordpress can get you up and running fairly quickly, but it also has it’s issues that you’ll need to address (security being a big one and using older versions of PHP)

If you have any comments feel free to post them up.

 

PyroCMS: Getting a WYSIWG text box in your module

I know I said Pyro would be put on the back burner for a bit but I ran across something that I think is worth sharing.

So working on my module and I wanted a WYSIWG editor in the admin portion.  Took a look at the blog module that’s part of core and saw that there needed to be a style associated to that textarea. So I did that, but it didn’t work.

Long story short you need to put this in your controller when your view is loaded. So you’d have something like this when your view is loaded (you also need to have a style on your textarea box as well).

$this->template
->title($this->module_details['name'])
->append_metadata($this->load->view('fragments/wysiwyg', array(), true))
->set('foobar',$foobar)
->build('admin/edit');

As near as I can tell this isn’t documented anywhere. I also suspect there some other ‘root’ level libraries that need to be loaded for your development purposes.

Code on!

PyroCMS: Take some time to explore

I finally made it back into some PyroCMS development today (and a little yesterday).  Today I really got into it and got some good time into my work project.  First I must say I’m a programmer that likes to get shit done.  I know on my first go around with code it’s not going to be the prettiest, but it will be functional.

So I was working on some models in PyroCMS and I had seen some stuff that I was curious about so I went exploring.  If you go into system/cms/core there’s a MY_Model.php which is what all your models will be extending.  Long story short there’s some helpful queries that should allow you to not have to create your own (ie: get_all() etc).  Having said that, I was not able to get it working in my application.  Again I just want to get shit done (feel like I’m a bit behind the gun right now), so I moved on (gave it a couple of good tries however).  I’ll go back to it at some latter point and write a bit more about it but for me it’s a golden nugget waiting to be explored and mined.

One of the things that I’m writing needs a multi-select dropdown.  Actually a couple of them.  So I got the results I needed and created my foreach loop (I find the CodeIgniter dropdown form helper damn near useless…I’m probably missing something, but the data I want to display is NEVER in the format that the function wants, so I just do a quick loop).  Any how once I’d got my code and loaded the page I was blown away.  I’ve had my differences on some of the PyroCMS stuff (file module in particular), but this little thing made me forget everything and shoot Phil a tweet and say thanks. I’m easily amused, but it was one of those moments for me where I was like “this is great…what else can I find and will the developers come up with”.  Give it a look when you get a chance (set a <select> to a multiple)

What little nuggets have you found in PyroCMS that made you fall in love with it?

Lastly I’ll be purchasing my first professional copy of PyroCMS this week for a site we are working on.  It will be our first PyroCMS site that is released.  Once it’s released I’ll post up something about it for all to check out.

I hope to have a bit more to post about rather than just rambling, but who knows.  The weather here in the west has finally gotten nice so there’s less time in front of the puter, unless it’s work related!

Happy coding all!

What’s your perfect work environment?

Having the perfect work environment has always been something I’ve striven for.  I’m not sure why that is, perhaps its because I’ve mostly worked in brick and mortar business’s and I see ‘new business’s’ that have these kick ass environments.  I think the other side of it is the fact that we spend so much time working away from our homes and our families that it sure would be nice if we were spending it somewhere that was a bit less sterile and more welcoming.

So here’s my perfect work environment. What’s your’s?

  • Standing desk – After 15 years of working at a desk my back is starting to hurt me.  And I do try and make an effort to get up and walk, but it doesn’t happen all the time.  
  • Ability to shut myself off from the world around me.  No phone calls, shut off the e-mail and no stop by and fix my problem.  
  • Collaboration.  Despite my want up above this I want the ability to work with other people and get stuff accomplished.  I like shooting the shit like anyone else, but I want to get something done and I want to grow by bouncing ideas off of other people. I don’t want a ton of people, just the right amount! I should add that they should also be passionate about it.  I see WAY to many people who just want to ‘press the button’ and be done with it.  
  • As an overall look and feel I like the industrial look.  High ceilings, no drop ceiling.  Pipes above your head.  Old brick walls and wood floors.  

Your turn. What’s your perfect work environment?

PS: I will be getting back to PyroCMS development commentary this next week and will have some more to say, I hope.  So sorry for being a bit quiet as of late.  Due to not having the above, it took me about 4 weeks to get some data imported parsed and into a database that I can now work with (doing some work that would have needed to be done now or later…I did it now!)

Where to find support for PyroCMS

I’m indirectly working on something with PyroCMS, but not diving into Pyro at this moment.  Once I do get back in there I’ll be posting some thoughts on that. 

Everyone, no matter what your level or experience of programming is going to need some support at some point.  And with Pyro being a fairly new CMS to the game I thought it was worth while posting something about where to get support.

  • Forums – Most obvious and I try and do my best to help out on there.  However I do see some posts go without any comments on it which is why I wanted to give a second opinion. 
  • IRC – There’s a few people that hang out on the IRC channel, sometimes the core devs, and you might get some response here if you need something quick.  

These two are the areas I would start with. There are a couple of Facebook groups for Pyro, on public and one private, that can be helpful as well should the first two no prove successful.

I have my next post in mind.  I’m not sure if I’ll post it up as it might be a bit controversial.

Anyhow happy coding!

Laravel 4 Information

These blog’s were recommended to me yesterday when I was looking for some beginner information on Laravel 4.  I haven’t read through all of them just yet, but they might help some of you on your way to Laravel 4. There is of course the documentation, here, but for someone that requires some baby steps, it was a step or 2 above what I was looking for.

As I’ve been posting a lot about PyroCMS on here you might be wondering why I’m looking at Laravel. Well in a couple of versions CodeIgniter will be replaced with Laravel 4.  I’m not sure what the process will be for developing with it, but the more that you know on Laravel 4, the better off you’ll be when this switch happens.

Happy coding.

 

PyroCMS Theme Creation: Must create blog templates

If you are creating a new theme for PyroCMS to sell or to keep for yourself here’s something to keep in mind.  By default Pyro comes with a blog ready to use and a contact page.  The contact page will use your default template, however the blog will not. You will need to modify/create templates for the blog.  This is documented here, but I’ll cover it anyways.

  • In your theme create a modules folder inside of views and then create a blog folder.  So you end up with something that looks like this.
THEME-NAME/views/modules/blog/
  • Inside of that blog folder you’ll put the four files that are required for the blog.  Those 4 files are:
archive.php
posts.php
view.php
rss.php

I think I’ve mentioned on here in a previous post that I’ve been in and out of PyroCMS a few times.  This site first existed as a PyroCMS site.  I had a few extra dollars in my PayPal account and I found a theme that I liked so I bought it.  Got it setup and was ready to roll. But wait.  It didn’t have a blog theme.  I had to set that up.  I mucked around with it for a bit and then decided I’d be best moving this site to WordPress.  So if you are a theme developer I’d encourage you to setup a blog template.  I don’t believe most people will be buying your theme for the blog stuff, but there’s a chance.  I feel like you should cover all of your bases with what is installed by default.  Additionally don’t make your users do any extra work. Do as much work for them as possible.