Skip to content

Instantly share code, notes, and snippets.

View bjornbjorn's full-sized avatar

Bjørn Børresen bjornbjorn

View GitHub Profile
<title>{title}{site_name}</title>
<meta name='keywords' content='{meta_keywords}' />
<meta name='description' content='{meta_description}' />
<link rel='canonical' href='{canonical_url}' />
<meta property="og:url" content="{canonical_url}"/>
<meta property="og:title" content="{entry_title}"/>
<meta property="og:description" content="{extra:desc}"/>
<meta property="og:image" content="{extra:image}"/>
@bjornbjorn
bjornbjorn / ext.oktan_web.php
Created October 1, 2012 14:00
Norwegian URL titles conversion array
/**
* Make sure url-titles look good for non-english entries also
*/
public function on_foreign_character_conversion_array()
{
return array(
'216' => 'o', // ø
'248' => 'o', // Ø
'198' => 'a', // æ
'230' => 'a', // Æ
@bjornbjorn
bjornbjorn / config.local.php
Created September 28, 2012 18:41
@focuslabllc Master Config file upload directory paths
$env_config['upload_preferences'] = array(
1 => array(
'name' => 'Uploads',
'server_path' => APPPATH."..\\..\\webroot\\uploads\\",
'url' => $env_config['base_url'].'uploads/'
),
);
@bjornbjorn
bjornbjorn / blog_index_entry.html
Created July 24, 2012 12:21
Infinite scroll with #eecms
{exp:channel:entries channel="blog" limit="1" offset="{segment_3}" dynamic="off" category="{segment_4}"}
{sn_blog_index_entry}
{/exp:channel:entries}
@bjornbjorn
bjornbjorn / mod.oktan_web
Created February 17, 2012 12:21
Creating a search_form() tag in an ExpressionEngine module
public function search_form()
{
/** ----------------------------------------
/** Get action ID for redirect_search method
/** ----------------------------------------*/
$hidden['ACT'] = $this->EE->functions->fetch_action_id(get_class($this), 'redirect_search');
/** ----------------------------------------
/** Return the final rendered form
/** ----------------------------------------*/
============( index.html )=================
{embed="sidebar" location="wiki"} <- In this case EE will treat the conditionals in sidebar.html as simple, and only one of the {exp:class} tags will run
{embed="sidebar"} <- in this case (where embed:location is empty) EE will treat all conditionals as advanced and run every single tag!
============( sidebar.html )=================
@bjornbjorn
bjornbjorn / mod.forum.php
Created October 26, 2011 08:22
Adding support for theme='' parameter in {exp:forum} tag
/**
This core hack in mod.forum.php will enable you to load a different forum theme from different templates.
Append in the constructor, just after $this->_load_base() like shown below.
*/
/** -------------------------------------
/** Load Base Forum Variables
/** -------------------------------------*/