When theming Drupal and wanting to output a view there are occasions where using a view display (e.g. a page, or a block - perhaps placed within a custom region ;-) ), or using Views Attach will not suffice.
Instead, you can embed a view using the following PHP snippet:
(NOTE: you'll need to have the core PHP input filter enabled if embedding in a node body)
<?php
$view = views_get_view('VIEWNAME');
print $view->preview('default');
?>or, if you need to use an argument with the view:
<?php
$args = array(ARGUMENTS);
$view = views_get_view('VIEWNAME');
print $view->preview('default', $args);
?>Just passing along this call for testing of the new Drupal.org theme - How to verify Mark Bolton’s mockups against the staging site - which I saw in my feed reader this morning. Seems like readers of this blog would be the perfect candidates :)
In this tutorial you'll see how to implement a toggling effect using jQuery within your Drupal theme whilst utilising Drupal behaviors.
The finished effect can be seen in this Drupal jQuery demo.
The toggle is achieved via a two-step process:
UPDATE
It appears that I missed the very obvious solution to this problem (!) which, as pointed out by a couple of commenters, is to use the ‘Trim this field to a maximum length’ option within the settings for the node title field.
I’ll leave this post in place as I think it still serves as a useful guide on how to create template override files for views, but please be advised that for implementing truncation of a views node title it is easier to:
Previously, I covered the topic of creating custom regions in Drupal 5 themes. However, Drupal 6 introduced a new process for creating custom regions in themes and it is still one of the topics people ask about most frequently.
So, here's a tutorial on how to create custom regions in your Drupal 6 themes. In this example I will use the Garland theme, and insert a new region called 'Uber content', which I'll position above everything in the main content area.

It's basically a two-step process:
The problem:
Drupal’s default 'Footer message' area (to which you can add content via the admin section - Administer > Site configuration > Site information) will not parse PHP.
If, for example, you add a copyright message to your footer message area such as "© Copyright 2009" it'll be fine until the New Year begins and you have to go in and manually change it to "© Copyright 2010". So, instead, it would be great if you could handle the date dynamically using the following PHP code (see http://php.net/date for further PHP date details):
© Copyright <?php echo date('Y'); ?>However, try adding that to the default 'Footer message' area and it will simply output the entirety of the code as text, ignoring the PHP tags.

So, what to do?
Solution 1:
Create a block (admin/build/block/add) containing the code, set its input format to PHP, and then place that block in the footer region via the main blocks settings page (admin/build/block). Crazy simple.
Just a quick note to say that the My Drupal Blog RSS feeds have been updated.
The local URLs are still the same:
Posts - http://mydrupalblog.lhmdesign.com/rss.xml
Comments - http://mydrupalblog.lhmdesign.com/crss
But the FeedBurner URLs are now slightly different:
Posts - http://feeds2.feedburner.com/MyDrupalBlog
Comments - http://feeds2.feedburner.com/MyDrupalBlog-Comments
Work, work, and more work have meant that I’ve rather neglected this blog as of late. But no more! Content is a-comin’ (slowly ;) ). And just a quick heads up for any comment RSS feed subscribers - I know that the feed is borked, and I may have to temporarily disable it whilst I resolve the issue (if, of course, I can access the Feedburner site, which is currently down). Fun times!
There are two big Drupal theming discussions happening right now, which I'm sure a number of you are aware of, but for those who aren't here's a quick summary:
1. Project Plan For A New Default Drupal 7 Theme
First up, lots of interesting stuff regarding the Project Plan for a new default Drupal 7 theme.
Right now this is a wiki page with an 8 step plan addressing the question of 'How do we get a new default theme in core?'. Step 1 'Create a project plan' has its due date set at November 7, 2008 so get in there quick!
Also, it looks like there will be a theming contest to create Drupal 7 sub-themes for core, once the new base theme has been finalised, which I'm sure will be of interest to a number of themers out there.
2. Drupal.org Redesign
Secondly, lots of discussion regarding Prototype Iteration #5 (including initial visual design direction) of the drupal.org redesign, which has gone online here.
Comments, discussion, suggestions etc. are welcomed by the authors on both of these topics.
Just a quick note to say that Chris over at xtnd.us contacted me recently regarding the updated Drupal API for Dreamweaver extension.
It's now in beta 2 with a full release expected for Q4 2008, and according to Chris "code coloring works, plus Dreamweaver can understand Drupal file types naturally now - like .module, .info, .theme, .install, etc."
You can find links to other xtnd.us Drupal products here.