This forum is for assistance with theme development.

Developing with PHPTemplate

I decided to migrate my site using the PHPTemplate engine. However, I am a PHP novice and have a
few general questions before I proceed.
As always with a new document I tried to deconstruct the box_grey theme and learn how it works. Here is what is not quite clear to me:

Do all the $xxx variables refer to stuff that is entered in the admin section such as the links content etc?

$head for instance seems to be set by using the set_html_head and get_html_head -I´m not sure how to do that. Can you call and set metatags that way?

image in node heading... a simpler way than nested divs?

Can anyone wthink of a simpler way to put an image in a node heading (the height of both lines - title and submitted) than using nested divs and floats?

thanks
c.

Input Format not working with node_teaser (input filters)

I'm trying to use the Filtered HTML input format to prevent layout tags from getting in my custom front_page display and messing up the layout. However, it seems that somehow input formats are not working to prevent tags like

from being posted into or displayed from a given node. Here is an example of code I'm using:

node_teaser($nodeloaded->flexinode_6, "Filtered HTML")

$teaser = substr(node_teaser($nodeloaded->flexinode_6, "Filtered HTML"),0,140);

Filtered HTML is the default input format, by the way. I've tried specifying or not specifying the format.

Because for whatever reason node_teaser is not applying the input format when creating the teaser. So I've resorted to using this:

$search = array ('@<div[^>]*?>@i', '@<p[^>]*?>@i', '@<table[^>]*?>@i', '@<td[^>]*?>@i', '@<tr[^>]*?>@i', '@</div[^>]*?>@i', '@</p[^>]*?>@i', '@</table[^>]*?>@i', '@</td[^>]*?>@i', '@</tr[^>]*?>@i');
$replace = array ('','','','','','','','','','');
$teaser = substr(preg_replace($search, $replace, node_teaser($nodeloaded->flexinode_6, "Filtered HTML")),0,140);

But this solution is not ideal because it is piecemeal blocking bad stuff, rather than blocking all and then allowing only acceptable stuff.

The reason I'm not just pulling the teaser text out of the database ($node->teaser) is because I don't want to use the flexinode default display of information (field description followed by field content).

Display node's $links in a block, in a bulleted list

I wonder if anybody can offer pointers about how to move all the links for a node into a block?

So, each node's full page view displays a block taking you to the links for that node.

I'm hoping there may be a way to do this with phpTemplate, or at least as an add-on module, so that no core files are modified.

Thanks!

Accouncing a new "Sliced Bread Theme Snippets" section to the handbook

Hi everyone,

I've been promising (threatening) to do this for a while, so I took some time out to get it kick started over the last few weeks. It's based on the enormous success of the "Sliced Bread php Snippets" idea, which has grown considerably since it started in 2005.

It's a new approach to how themes and layouts are contributed to Drupal and is based on the following assumptions:

  • There are very few themes being contributed to Drupal compared to modules
  • Drupallers may not have the time to contribute their themes
  • Drupallers may feel nervous about many people using their themes and every site looking the same as theirs
  • Drupallers might prefer to have a distinctive and exclusive design/layout. (illustrated well by the responses to "Why can't I get the drupal.org theme?")
  • It's quite a job to prepare a full theme for distribution - because of the sheer depth and dimensions to Drupal, it's not just a "skin" that is needed, it's a collection of themes that covers the front, blogs, lists, admin, comments, nodes etc.
  • The first thing Drupallers do when they download a theme, is strip it apart
  • It's much easier for Drupallers to contribute theme and layout snippets rather than full themes

Modular based theming

Drupal is 5 years old and it's incorrectly compared by some to other blogging or CMS tools where only a "skin" is really needed. The depth and dimensions to a Drupal site means a "skin" is not enough. I would argue that it is a collection of skins for specific areas and therefore it is difficult to expect the THEME DOWNLOADs section of the site to be just as populated as other sites.

Pages

Subscribe with RSS Subscribe to RSS - Theme development