Friday, 29 August 2014

if field is empty hide div - the golden ticket.

Working on a project today, and came across an age-old struggle; Simon vs. Various Coding Languages. I am building out a project page using Advanced Custom Fields (for WordPress), and I built out these neat little cards, with an image, title, and blurb, and two buttons on the bottom. 

Not knowing how many cards my client would need for each section, I built out a total of 10. But what if the client only needs 8 on a particular page? There are still ugly buttons underneath a blank spot with no image or text - this will not do.
I spent 30-40 minutes noodling around jQuery and could not sort out how to hide the div if the particular field was empty. 
Chris Coyier of CSS Tricks has a good article, but I was unable to sort it out and adapt it to my situation. I am rather overwhelmed with PHP, as I am only familiar with WP's brand of PHP. 
Short of the long, here is what I found:

<?php if (get_field('region10') && get_field('region10') != "") { ?>

    <article class="one-third-space region-card">
    <img src="<?php the_field('region10-image'); ?> " alt=" <?php get_image_tag($alt); ?> ">
        <div class="text"><?php the_field('region10'); ?></div>
<a href="<?php the_field('region1-link'); ?>">
<button class="button bg-orange centre">MORE DETAILS...</button>
</a>
<button class="button bg-blue centre">RESERVE THIS TRIP</button>
</article> <?php } ?>

The fields I created are called 'region10' . The PHP is wrapped around the whole section which it will logically decide to show or hide what's inside. 
"IF THIS FIELD IS EMPTY, SHOW NOTHING (denoted by " ")"

As a front-end developer I cannot explain it any deeper than this, and I truly hope this helps.

Wednesday, 13 August 2014

Is The Government Spying On Us Via The Internet?

In short, the answer is yes. The whole Internet is spying on you, but it’s not because you are special. On one hand - “I’ve got nothing to hide, let them peek!”, the other – “This is a breech of my rights!”. Sure, both arguments are fair, but we must keep in mind the big picture here. There’s really not a whole lot we can do about it.

Sure you’ve got nothing to hide, and you did check that ‘I agree to Terms and Services’ checkbox before you downloaded/joined/signed up for the service, and the Internet is not publicly owned (even though it really really should be).  The thing is, the services we sign up for are using your private information and selling it to advertisers, governments, and corporations. 

Pro-Spying Argument:
If you were a terrorist, I’m sure they would be retroactively searching through your Facebook photos, or e-­mail accounts, but can you imagine the amount of e-­mails people would have to filter through to find anything of value? Even though you are allowing (or enabling) these groups to use your personal information as they please, we were somehow mislead into thinking this was okay, or this is how it has to be. You must keep in mind: WE ARE BEING TAKEN ADVANTAGE OF. 

If you sign up for a social service, and are –by choice-­ displaying personal information for the world to see, that’s your business. BUT when companies are using your search history, collecting your location data, and selling it to others for huge profit, only to be used against you this is not right.

The greatness of a network that can connect the world, share trillions of bytes of current information, making everybody a part of a collective consciousness has the potential to be one of the greatest progressions of human behavior and thinking this planet has ever seen.  This massive thought alone is why the Internet shouldn’t be used for mining data and personal information of the people who use it. The network as a resource is what should be taken advantage of; not it’s users. 


Next time you sign up for a social service, do yourself a solid and read over some of the ‘terms of use’. You may find it interesting how many little things hide in that small print. Inform yourself, and know what you’re getting into; you’re worth a lot more than a marketing statistic.

Saturday, 2 August 2014

Talk Is Cheap, Good Web Design Isn't

What I would like to do, is build small business websites and make a living doing it. I am not yet what I would call a 'good web designer' but I'm getting there.

Since I am fresh on the East Coast, I have yet to make a good supporting group of business contacts, so I've been advertising on Kijiji.
I get approximately one inquiry per day from these ads I keep on there, and so far, 3 potential leads have got me zero jobs.
The inquiries are already classic and stereotypical;
"How much for a website?"
"Well," I tell them, "it depends on the project, but $300 for the home page and design, and $200 per additional page." Completely reasonable rates; I need to feed my family, but I am hardly a professional.
I don't charge a lot, do decent design work and know my way around CSS and HTML environments. Most importantly, I keep up on modern web & design trends and best practices.

There are so many ads on there for "Custom Website, only $300!"

Side Note: So many of the portfolio sites affiliated with these ads are 'copyright 2001', and some of them are those horrifying pieces of work that you occasionally come across and think, "Was this ever a thing?" Well it was...
There was a time when people who made websites were people who only knew the Hypertext Markup Language (or more recently Flash) that built them. They weren't designers, and it shows.

These "Custom Websites" are static and HTML based, and apparently have little place in the web today. Everything is going Dynamic for more reasons than one, and so, the web designers and developers of today must follow suit.

I suppose I could code you a website - pure static HTML, like a business card - for as little as $200, but you're going to have to get a new one built next year, when you realize Google wants nothing to do with the static web and blacklists the website.

In summary, I need to feed my family, and $300-$500 is not a lot for a nice site, when a good website and some good advice can provide a great return on investment.