Skip to content

Instantly share code, notes, and snippets.

View jeremyboggs's full-sized avatar

Jeremy Boggs jeremyboggs

View GitHub Profile
@jeremyboggs
jeremyboggs / simple-search.scss
Created November 26, 2012 21:29
SCSS/Compass styles for a simple search form.
#search-form {
position:relative;
@include trailer(1);
input {
margin:0;
&[type=text] {
color: #555;
width:100%;
border: 0;
@jeremyboggs
jeremyboggs / remove_item_edit_form_element.php
Created November 6, 2012 16:44
Remove a form element in Omeka
<?php
add_filter(array('ElementForm', 'Item', 'Dublin Core', 'Title'), 'remove_form_item_title');
function remove_form_item_title($components, $args) {
$components['html'] = ''; // Set the html component to an empty string.
return $components;
}
@jeremyboggs
jeremyboggs / custom.php
Created November 6, 2012 14:22
Custom show_item_metadata function for Omeka that loops through an internal array of labels and their associated fields.
<?php
/**
* Show Item Metadata function that loops through an internal array of labels
* and their associated fields.
*
* @param Item|null $item
* @return string The HTML for the item metadata.
*/
function berlin_show_item_metadata($item = null)
@jeremyboggs
jeremyboggs / omeka-theme-checklist.md
Created November 2, 2012 17:17
Checklist for developing an Omeka theme

Omeka Theme Checklist

Checklist for developing an Omeka theme. Things to check, ensure they look and work OK.

  • Homepage
    • Display featured item
    • Display featured collection
    • Display recent items
  • Readability (A simple page with a variety of markup—headings, paragraphs, lists, blockquotes, links, etc.)
  • Items
@jeremyboggs
jeremyboggs / functions.php
Created November 1, 2012 15:07
Switch certain field headings in Omeka's custom_show_item_metadata function.
<?php
function custom_show_item_metadata(array $options = array(), $item = null)
{
$item = $item ? $item : get_current_item();
if ($dcFieldsList = get_theme_option('display_dublin_core_fields')) {
$otherElementSets = array();
@jeremyboggs
jeremyboggs / item-metadata.php
Created October 23, 2012 19:48
Changes different heads for various DC fields.
<div class="element-set">
<h2><?php echo html_escape(__($setName)); ?></h2>
<?php foreach ($elementsInSet as $info):
$elementName = $info['elementName'];
if ($setName == 'Dublin Core') {
switch($elementName) {
// Check if $elementName is 'Description'
case 'Description':
$elementName = 'Header'; // Change value of $elementName to 'Header'
break;
@jeremyboggs
jeremyboggs / custom_excerpt_more.php
Created October 11, 2012 15:16
Filters 'excerpt_more' in WordPress to provide a 'Continue reading' link. Add to your theme's functions.php file.
<?php
/**
* Filters 'excerpt_more' to provide a 'Continue reading' link.
*/
function custom_excerpt_more($more) {
global $post;
$more = '&hellip;. <a href="'. get_permalink($post->ID) . '">Continue reading.</a>';
return $more;
}
@jeremyboggs
jeremyboggs / get_files_by_mime_type.php
Created September 30, 2012 14:15
Get Omeka files with particular MIME types. Defaults are HTML, XML, PDF, RTF, Word, and plain text.
<?php
/**
* Helper to only retrieve files with particular MIME types. Defaults include:
*
* - HTML (text/html)
* - XML (application/xml)
* - PDF (application/pdf)
* - RTF (text/rtf)
* - MS Word (application/msword)
@jeremyboggs
jeremyboggs / queue_theme_assets.php
Created September 25, 2012 20:04
Queues Omeka theme assets
<?php
function queue_theme_assets() {
queue_js('modernizr.min');
$respondSrc = src('respond.min.js', 'javascripts');
$modernizrLoad = "Modernizr.load([{test: Modernizr.mq(), nope: " . "['$respondSrc']}]);";
queue_js_string($modernizrLoad);
__v()->headScript()->appendFile(src('selectivizr.min.js', 'javascripts'), 'text/javascript', array('conditional' => 'lt IE 9'));
@jeremyboggs
jeremyboggs / neatline_maps.js.diff
Created September 25, 2012 18:42
Diff that adds the Imperium Romanum map as a baselayer in Neatline
diff --git a/views/shared/javascripts/neatline_map.js b/views/shared/javascripts/neatline_map.js
index 8894897..253d73a 100644
--- a/views/shared/javascripts/neatline_map.js
+++ b/views/shared/javascripts/neatline_map.js
@@ -848,6 +848,17 @@
}
);
+ this.imrm = new OpenLayers.Layer.XYZ(
+ "Imperium Romanum",