<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>title goes here » Site title here</title> <base href="" /> <meta name="Author" content="#" /> <meta name="Description" content="#" /> <meta name="Copyright" content="#" /> <meta name="Robots" content="#" /> <meta name="Generator" content="#" /> <meta name="Keywords" content="#" /> <meta http-equiv="Expires" content="#" /> <meta http-equiv="Cache-Control" content="#" /> <meta http-equiv="imagetoolbar" content="false" /> <link rel="Shortcut Icon" href="/favicon.ico" type="image/x-icon" /> <link href="/script/javascript.js" type="text/javascript" /> <style type="text/css" xml:space="preserve"> /*<![CDATA[*/ @import url(/css/style.css) all; /*]]>*/ </style> <link rel="stylesheet" href="/css/screen.css" type="text/css" media="screen, projection" /> <link rel="stylesheet" href="/css/print.css" type="text/css" media="print" /> <!--[if IE]> <link rel="stylesheet" href="/css/win-ie-all.css" type="text/css" media="screen, projection" /> <![endif]--> </head> <body> </body> </html>
Tag Archive for template
XHTML 1.1 Web Standards Template — Fixed
Drupal theming list Views to display like menus
<?php
function THEMENAME_views_view_list_VIEWNAME($view, $nodes, $type) {
foreach ($nodes as $node) {
$output .= "<li class='leaf'>" . l($node->node_title, "node/$node->nid") . "</li>
";
}
if ($output) {
return "<div class='menu'>
<ul>
" . $output . '</ul></div>';
}
}
?>
Separate theme for a specific node
<?php
function _phptemplate_variables($hook, $vars = array()) {
switch ($hook) {
case 'node':
$vars['template_files'] = array('node-'. $vars['nid']);
break;
}
return $vars;
}
?>
Customize search results
<?php
/**
* Theme override for search results.
*
* Replace themename with your theme's name.
*/
function themename_search_item($item, $type) {
$output = ' <dt class="title"><a href="'. check_url($item['link']) .'">'. check_plain($item['title']) .'</a></dt>';
$output .= ' <dd>'. ($item['snippet'] ? '<p>'. $item['snippet'] .'</p>' : '');
return $output;
}
?>
Non collapsible advanced search
<?php
/**
* Theme override for search form.
*
* Replace themename with your theme's name.
*/
function themename_search_form($form) {
$output = '';
// Print out the $form array to see all the elements we are working with.
//$output .= dsm($form);
// Once I know which part of the array I'm after we can change it.
// You can use the normal Form API structure to change things, like so:
// Change the advanced search field to non collapsible.
$form['advanced']['#collapsible'] = 0;
// Make sure you call a drupal_render() on the entire $form to make sure you
// still output all of the elements (particularly hidden ones needed
// for the form to function properly.)
$output .= drupal_render($form);
return $output;
}
?>
Drupal 5.x page.tpl.php template
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language ?>" xml:lang="<?php print $language ?>">
<head>
<title><?php print $head_title ?></title>
<?php print $head ?>
<?php print $styles ?>
<?php print $scripts ?>
<script type="text/javascript"><?php /* Needed to avoid Flash of Unstyle Content in IE */ ?> </script>
</head>
<body>
<!-- logo -->
<?php if ($logo) { ?><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" /></a><?php } ?>
<!-- site name -->
<?php if ($site_name) { ?><h1 class='site-name'><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a></h1><?php } ?>
<!-- sloagan -->
<?php if ($site_slogan) { ?><?php print $site_slogan ?><?php } ?>
<!-- primary links -->
<?php if (isset($primary_links)) { ?><?php print theme('links', $primary_links, array('class' =>'links', 'id' => 'navlist')) ?><?php } ?>
<!-- secondary links -->
<?php if (isset($secondary_links)) { ?><?php print theme('links', $secondary_links, array('class' =>'links', 'id' => 'subnavlist')) ?><?php } ?>
<!-- search -->
<?php print $search_box ?>
<!-- header -->
<?php print $header ?>
<!-- mission -->
<?php if ($mission) { ?><?php print $mission ?><?php } ?>
<!-- breadcrumb -->
<?php print $breadcrumb ?>
<!-- content with headline and tabs -->
<h1 class="title"><?php print $title ?></h1>
<div class="tabs"><?php print $tabs ?></div>
<?php print $help ?>
<?php print $messages ?>
<?php print $content; ?>
<!-- sidebars -->
<?php if ($sidebar_left) { ?>
<?php print $sidebar_left ?>
<?php } ?>
<?php if ($sidebar_right) { ?>
<?php print $sidebar_right ?>
<?php } ?>
<!-- feed icon -->
<?php print $feed_icons; ?>
<!-- footer -->
<?php print $footer_message ?>
<!-- and finally close the document like this: -->
<?php print $closure ?>
</body>
</html>
Google Analytics ga.js Script
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("{0}");
pageTracker._initData();
pageTracker._trackPageview();
</script>
PureMVC XML DataProxy Class Template
/**
* Base PureMVC Project
*/
package model
{
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import org.puremvc.as3.interfaces.IProxy;
import org.puremvc.as3.patterns.proxy.Proxy;
import ApplicationFacade;
public class DataProxy extends Proxy implements IProxy
{
public static const NAME:String = "DataProxy";
public function DataProxy()
{
trace ("DataProxy instantiated");
/**
* Here, we initialize DataProxy with a var named "data"
* of type Object(), a built-in property of the Proxy class.
* This var will be used for storing data retrieved from the xml document.
*/
super( NAME, new Object() );
var loader:URLLoader = new URLLoader();
loader.addEventListener( Event.COMPLETE, onDataLoaded );
loader.load( new URLRequest( "data.xml" ) );
}
private function onDataLoaded( evt:Event ):void
{
trace ("DataProxy.onDataLoaded()");
var xml:XML = new XML( evt.target.data );
xml.ignoreWhitespace = true;
/**
* When DataProxy is done loading and parsing data, it
* sends an INITIALIZE_SITE notification back to the framework.
*/
sendNotification( ApplicationFacade.INITIALIZE_SITE );
}
}
}