Sunday, July 19, 2009

Speeding Up the Site

I have decided that since I don't have too much time in the next three months to update a lot of the UI for this site then I will be spending my time making it load faster, especially on the main page.  This first bottleneck that I noticed was when the feeds at the bottom of the page where being de-cached, the entire page was not being loaded until they were done.  This has been rectified by having those load separately through AJAX calls after the page has finished loading.


The next area of improvements will be the portfolio gallery.


It is all about getting to where you have to go faster and more efficient.


Thursday, July 16, 2009

Posterous Is Keeping It Simple

Leveraging social media outlet's to promote your site can be a love/hate relationship.  While the power of promotion is undeniable within the social networking outlets to spread the gospel of whatever business or service you are offering, it can be a daunting task to note only keep up with the number of sites out there, but also maintaing them.  You are seeing more and more companies having to extend their marketing or PR departments to include employees whose day to day tasks are to post and moderate these sites.

One of the statements that I hear most often from clients is that they want to have a presence on Facebook, Twitter, YouTube, LinkedIn, etc., as well as blog, but they don't want to  have to update twenty different sites.  The best solution by far for this is to use Posterous.

Posterous is by far the EASIEST service for not only, blogging, but also blasting out updates to individual services or groups of services at once.  Just send an email to post@posterous.com and you have an instant blog.  You don't even have to create an account first, but if want to have access to some of their other services then an account is required.  If you want to attach a video to blog or images...no problem. Just attach them to the email and embedded videos are added to the blog post as well as, images and audio files.

While some people require more advance features from a blog or need to have better control of their design, then there are plenty of great choices for them to choose from. However, I have found that most people don't have the time to do anything other than email.  Well your white horse has arrived.

Just send an email.  It doesn't get much simpler than that.

::NOTE:: This blog was posted using Posterous.

Posted via email from Cory Wiles Blog

Monday, June 8, 2009

WWDC Day One

While I can't disclose all that I learned from the WWDC, due to the NDA, I will say that it has been amazing.  Apple has not only put on a well oiled conference, but the new product lines as well as tools and resources available have just been amazing.

In case you didn't catch today's keynote here are some highlights:

  • Macbook Pros now come in 13in, 15in, 17in models
  • Macbook Pros can have up to 8gb of RAM
  • Macbook Pros have SD Slot
  • Snow Leopard has an almost seamless connection to Exchange
  • Snow Leopard and iPhone SDK use 90% of the same framework/APIs
  • Prices have dropped tremendously
  • iPhone 3g are now only $99
  • iPhone 3gp[s] are coming in 16gig/32gig
  • iPhone 3.0 now supports voice dialing, improved camera (with autofocus and highlighting), video camera with in-context editing and digital compass.
Obviously there was much more discussed so to get all the juicy details check out the keynote video.  

Friday, June 5, 2009

WWDC Next Week in San Francisco

The party will begin in roughly three days. I am one of the lucky individuals who is attending the 2009 WWDC in San Fransisco. With all the rumors flying around the web right now it is definitely hard to discern fact from fiction, but I have been working diligently on my first iPhone application using the 3.0Beta_3 SDK and while I can't speak specifically about a lot of the new features, because of the NDA, I can say that Apple once again has kept the users in mind with the new features. All will be pleased.

Everyone from developers to the casual user.

For up-to-date information on the conference just follow me on Twitter.

Friday, May 1, 2009

Wednesday, April 22, 2009

Targeting Nested LI's with jQuery

After two days of trying every DOM hierarchy transversile that I could think of or learn from I was about to give up. The task at hand was fairly simple. I was creating a TreeView menu for a given directory. The top level nodes where generated when the page loads and if the top level "resource" is a directory then when that item is clicked an AJAX call is made to get it's sub-resources which are nested ul/li.

In order to make subsequent calls for any directories/files that are > the first level I need to get the id of the li tag that is clicked (only directories have the ability to be clicked).

I thought I would be able to navigate through the DOM hiearchy to the nested li and retrieve the id, however, this becomes a problem with nested ul/li's because if you try to alert the id and expect the result to be of the nested element you will get the id of the parent element.

List Items


  • [+]applications


    • lib
    • index.php
    • settings
    • .htaccess
    • images
    • css
    • views
    • js
    • modules
    • layouts
  • [+]ops

// doesn't work

$(document).ready(function() {

$("li").click(function() {
alert($(this).attr('id'));

})
});


// does work
$(document).ready(function() {

$("li").click(function(event) {
alert(event.target.id);

})
});


The solution was to pass and event object to the click event handler. After I figured out that little nugget it only took me another hour to finish up my script.

Sunday, April 5, 2009

Zend Framework Dynamic Site

::UPDATE - 04.09.2009::
I finally was able to create an example of the below described site.  If you have any questions/comments please let me know.

When creating a website, especially in the corporate/enterprise world, it assumed that you have to use some sort of content management system.  The range, and subsequent debate, could be everything from free (Joomla, Wordpress, Drupal) to the very expensive (Vignette).  While I am in a firm believer in the use of a CMS it seems lately I have been asked to develop sites whose content doesn't change that often, but the responsibility still needs to fall into the hands of a content editor not a developer.  In addition, the designer that I work with wanted the freedom of creating as many templates as he wanted and tweak the design without having to consult me, the developer, nor have to work with a content editor to update any of the content pages.

I went back and forth how to best solve this solution.  While Joomla and Wordpress would have certainly handled all of these requirements there is the overhead that comes with any CMS and with the requirements that I had to work with I kept asking myself if using a CMS was lighting a grill with an atom bomb.

The end result was a hybrid between using static "html" and a mini-CMS....all using the Zend Framework.  I came up with a way that separated the content, layouts, and the developer maintained backedend of the site.

Basic requirements:
  1. SEF's
  2. Breadcrumb subheadings
  3. Flexible layouts - some pages might need a "one column content well", "one column content well with a side bar", etc
  4. Content pages should be kept in one location
  5. Templates should be independent of backend code and content
Directory Structure:
  • content
  • css
  • images
  • index.php
  • js
  • layouts
  • lib
  • modules
  • settings
How It Works
  • Creating/Editing Content


    1. Create the static phtml file in the content directory
    2. Edit the content.xml file in the content directory and add the following attributes and/or nodes: url - 1) what the request url will be. 2) file - the name of the phtml file (minus the extension). 3) pageTitle - self explainatory 4) layout - what template do you want to use for the page
  • Page Rendering


    1. Zend Layout
    2. Zend MVC
    3. Custom regex route
    4. Custom Site Page Render Plugin

Plugin and Go

The majority of the site dynamics happens in the custom plugin - routeShutdown method.
  1. Based upon the $_SERVER['REQUEST_URI'] the appropriate "page" node is located: "//pages/page[@url='{$_SERVER['REQUEST_URI']}']".
  2. The page title is set
  3. The name of the view (phtml) file is set
  4. The breadcrumbs array is populated. *
  5. All the attributes are then set as an array of params and set in the request.
  6. The IndexController/indexAction grabs the params, sets them to view properties to be displayed in the layout

*::NOTE::
Since there is technically not a hierarchy of files on the web server... the way that the url is decided upon is by the content editors.  Because of this there is a business rule in place that the "toplevel" navigation is the first set of characters in the url and child navigation thus follows.  In the method the breadcrumbs are created by parsing this pattern.

Conclusion
While there is definite room for improvement to how the site management is done we have seen great efficiency not only how the site is maintained and content is created, but also the amount of code that is used to generate the site.
  • 1 module, 1 controller, 1 action, 1 custom plugin
  • developers, content editors, and designers are able to work on their respective portions of the site without having to rework or update any other aspect of the site in 99% of use cases.

I finally was able to create an example of the below described site.  If you have any questions/comments please let me know.