Archive for December, 1969


Page 11 of 11« First...«234567891011

Implementation of my comments in Expression Engine

Some of you asked for an Expression Engine tutorial a while ago and I thought today would be a good moment to explain how I implemented the comment boxes on my site. There is a lot to talk about so lets move ahead and get on to it…

What's on the EE menu today:

  • Alternating comment boxes and your own comment box
  • The use of gravatars
  • Permalink a comment
  • Number the comments
  • Hide the e-mail address and show URL
  • Date and time stamp

Alternating comment boxes and your own comment box

Having the comment boxes alternate in style is a must. It gives a nice overview, it's more pleasing for the eye. Having your own comment box is even better. It's not that difficult to implement. I'll show you how.

The static XHTML code

Let's have a look first at our static code:

the static XHTML code

The outer div has a class "comment-box". This div will get another class named "comment-box-alt" for the alternate style of this box and a class "comment-box-v" for the style of the box when I enter a comment.

The EE code

And here is the EE code:

the EE template code using the switch variable

What I did is using the "switch" variable. BTW, you can add more then just 2 styles.

To give my box a special style, I used a conditional variable, which allows you to conditionally show or hide information based on criteria being met. In case you want to highlight your own comment box, you could check this by using your e-mail address. "!=" means "not equal to" "==" means "equal to".

Have a look at the complete EE code

the complete EE template code

The use of gravatars

For the gravatars I use Les Jenkins' plugin which works with gravatar.com. Just download the plugin and place it in EE's plugins folder on your server. Then add the proper EE code (shown in the image above).

Permalink a comment

To give each comment a permalink I use the comment_id variable. Because these are pure numbers and I want my code 100% W3C valid, I added "c_" in front.

Number the comments

Just add the variable count (the word count between curly brackets) to number your comments.

Hide the e-mail address and show URL

To hide the e-mail address of user, make sure that the "Automatically turn URLs and email addresses into links?" EE Admin is set to "No". You'll find this in Admin > Weblog Management > The name of your blog > Comment Posting Preferences.
As you can see I've used conditionals again: if the URL field in the form is not (!=) empty, then render the link and if not than the link won't be rendered and you'll only see the name. Notice how I added this conditional around the "a" element in 2 separate parts. I added it around the opening tag and a second time around the closing tag.

Date and time stamp

The date and time stamps are also pretty easy to do. Well, everything is, you just need to find the proper code :) I always browse to this overview of the date and time formats you can use in EE.

Additional info

The word "comment" between curly brackets will render the comment. The "link" between curly brackets is a variable I've created that replaces my URL. So each time I want to use this 'path' I just type "link".

Hope you enjoyed my mini EE tutorial. Don't forget to browse the user manual. You'll find a bunch of information there. And if you just start on implementing your templates, make sure you copy the default templates in a separate template group and use them to learn from. Well, that's how I did it ;)

Comments off

Life update part 2

In one of my previous posts I promised that I had some more news about what is going on in my world lately. As most of my readers know I’m always pretty busy and the balance between work and life is mostly in favor towards work. I’m not complaining or anything, in fact that’s how I like it. But a few months ago we received some news that has thrown everything out of balance completely.

Unexpected news

Two months ago on a beautiful Friday morning the postman brought us some disturbing news from our landlord that we need to leave the building. We have lived here for twelve years and knew the owner rather well. He lives just across the road so we saw him several times a week, but still he failed to mention any of this news to us. The official notice was the first time. Is it just me or would you expect more after such a time? It's not that we are bad tenants, we always payed on time and even helped him out on several occasions.

6 months to find something...

Luckily for us we live in a country that has its shit together if something like this happens. They have to give us 6 months to find something else, at least a decent period if compared with the US where this is only a month according to my overseas friends. So after the initial shock we did what any true geek would do and that's checking the Internet for a new home. Now you have to know that we stayed at our current place so long because rent was pretty low and we never actually created time to search for something. Always work work :)

Buy or rent?

We both felt that it wasn't opportune anymore to rent something, prices for a place big enough to work and live would cost us as much or more than buying a new one. So after all that calculation work the pretty amazing thing was that it took Geert only 3 pages on www.easy.be to find a place that we both liked very much. But as you know it is always smarter to look around a bit more and that's exactly what we did. We drove around for two weekends but didn't find anything better than our first love. It's true what they say, you have to fall in love with a house and feel its vibe or potential.

Houston we have a house!

Recent statistics showed that 70% of the people in Belgium own a house and now we are included in those figures :) There is even a saying that every Belgian citizen gets born with a brick in his stomach. As any house owner knows it comes down to money, so as you guessed by now we had to talk to several banks too to get the best deal. Luckily for us we have an accountant that is a true diamond and he helped and assisted us in this matter. We own him a great deal of gratitude!

I'm proud to say that we now own a house that will also have enough room to fit Duoh! our company. It's a new house that they are still building only a few minutes from where we live now. You also have to imagine that most people prepare such a life changing thing a year ahead. We didn't know anything about building a house at all, the work and exploration that comes with it like choosing tiles, parquet, bathroom, kitchen, lightening etc. We never spend so much time in shops as of late!

So much to do and to plan + some reader advice...

Of course it's all exciting and if you know me from my work environment posts, you know I like to decorate. But for painting we will have to wait for a year because the plastering of the walls needs to dry out. That's not bad at all since there is so much else to do. That's were I hope I can learn a little from my readers too. For example we are thinking about contacting a carpenter to:

  • Create an table like the ones you find in the Apple Store.
  • Another thing that comes to mind are custom made built-in cabinets.

We would like to have a similar table for our office

I was wondering if any of my readers have experience in this and would like to share tips and experiences in the comments. Is this something that is expensive? Materials don't have to be top notch just good looking if you know what I mean. Another thing that I would like to know a little more about is:

  • working with a landscape architect to design your garden

So if you have something interesting to tell, please don't hesitate. It can be about anything that has to do with building a new house. Thanks in advance angels :)

Comments off

How to set up a full bleed design in Photoshop

Not sure if this is a cool tip, but this is something I always do when I start on a full bleed design in Photoshop (I mean a design for print, obviously). I thought I share this one with you…

Here is was I do:

  • I create a new document using the exact dimensions
  • I add guides on all sides of the document (make sure Snap to Document Bounds is checked in the View menu)
  • I add the bleed area by enlarging the Canvas Size (Image > Canvas Size)

For me it's just a logical thing to do, but I know from reading the comments on my blog, that everyone does things differently. I'm curious now, do you do exactly the same or do you have a smarter trick?

Comments off

Page 11 of 11« First...«234567891011