Login
Home
Eoin Bailey . com
Tech, Research, Code, Work, and Fun
  • Home
  • Eoin's CV
  • About Eoin
  • Ph.D.
  • Blog
  • Galleries
  • Training
  • Polls
  • Tags
  • Weblinks
  • Site map
  • Contact

Tag Cloud

algorithm antarctica apple banking browser code copyright cycle data centre devel Dijkstra drupal drupalcamp economics escapades facebook firefox galway Google iphone ipod livigno theme training weights
more tags

A Random Image

Filesystem Hierarchy Standard

Syntax Highlighter

Submitted by Eoin on Fri, 10/07/2009 - 12:56
in
  • Code-Work
  • drupal
  • General-Personal
  • General-Work
  • module
  • syntax

Another day, another new module at eoinbailey.com, today it's the Syntax highlighter drupal module, which makes use of the javascript syntax highlighter library.

This module allows me to markup code in a very nice looking way, for example:

// This is a comment about this code
function trace_preprocess_page(&$variables) {

	if ($variables['node']->type != "") {
	    $variables['template_files'][] = "page-node-" . $variables['node']->type;
	}
// END OF FILE

The code above would go in a themes 'template.php' file, and with that you can now create a php file to theme each specific content type, with the name of the file being "page-node-.tpl.php".

$(document).ready(function() {
    
	$("#align-front-options").equalHeights();
});

The code above is javascript, and makes use of the rather handy plugin for jQuery that equalises the heights of elements contained within the container "#align-front-options".

Basically this new module is pretty cool! Also, you, the visitor to this site, can also view the code without line numbers, making it very easy to cut and paste. Just check out the buttons at the top right of each of the code boxes.

  • Eoin's blog
  • Printer-friendly version
  • Send to friend

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Images can be added to this post.

More information about formatting options

Current Poll

What is your current phone OS?:

Freelance Work

A sample of websites I have developed:

  • Studio Richards
  • Medilex
  • Design21C
  • The Spine Clinic
  • Abrivia - Careers and Outplacement
  • Emilie Conway

Twitter

Follow @eoinbailey

Some Links

  • James Bond Opening Scenes
  • Polls
  • Chess Module-Drupal
  • Ski Trip Jan 2009

Training

  • Spinning
  • Hodson Bay Hotel Training
  • Spinning Class - Not too Shabby!
  • Bike Time Trial
  • Spinning Class of Anti-Doom!

Recent Comments

  • Happy New Year 2012!
  • Thank you..
  • Simple way
  • Yep, CSS is an option - there
  • Maybe CSS is an easy solution?
  • Thanks for the direction.
  • Thank you for the insight.
  • Exactly.
  • Thank you for the insight.
  • I'm open to correction on

Powered by

Powered by Drupal, an open source content management system

Recent blog posts

  • Leap Card
  • A new College term - Dijkstra's Algorithm
  • Dublin GTUG - June 2011 - Over 100 attendees
  • City of a Thousand Welcomes
  • Groupon et al. - "Bet on the Future"
  • Dublin Web Summit - DWS6 - Roundup
  • Anti-Spam - Using a Catch-All to identify bad companies
  • Hide a Note Title - Drupal 7
  • The Election on Hit The Road
  • Syntax Highlighter Module - Javascript Problem
more
Copyright © 2012 Eoin Bailey . com.

I'm trying out: Web Analytics