Configuration Options
The iastate-theme package contains the public assets (image, stylesheet) and php class needed to quickly create new pages using the ISU Template.
The following options are supported by the theme by default.
Head
head_title
This value is placed in the document head inside a <title>
tag. If null
it will be populated with the page_title
, site_title
, and org_title
all separated by the title_separator
.
Default:
function(Theme $theme)
{
$titles = [];
foreach (['page', 'site', 'org') as $type)
{
if (($part = $theme->getOption($type .'_title')) != null)
{
if (count($titles) && $titles[count($titles) - 1] == $part)
{
continue;
}
$titles[] = $part;
}
}
return $titles;
}
title_separator
The title separator used to separate each title part in head_title
.
Default: ' • '
head_meta
An array of <meta>
items to place in the document <head>
. Use unique keys for ease of use.
Items are provided as key => value
pairs and the values can be of type:
- string
- will use the
value
as the content and thekey
as the name. - array
-
content
: the content attribute valuekey_type
: primary attribute namekey_value
: primary attribute value
Default:
[
'charset' => 'utf-8',
'x_ua_compatible' => [
'content' => 'IE=edge,chrome=1',
'key_value' => 'X-UA-Compatible',
'key_type' => 'http-equiv',
],
'viewport' => 'width=device-width,initial-scale=1',
],
head_script
A stack of <script>
items to place in the document <head>
.
This option contains two keys: file
and script
. Use the first option to include files,
and the second for inline scripts.
- file
-
Array of items provided as
key => value
pairs and the values can be of type:- string
- will use the
value
as the src. - array
- an array of attribute
name => value
pairs and an additionalorder
key to determine order within the stack.
- script
-
Array of items provided as
key => value
pairs and the values can be of type:- string
- will use the
value
as the inline script content. - array
-
content
: content of the script elementattributes
: additional attributes to apply to<script>
order
: order of item within the stack
Use unique keys for ease of use.
Default:
[
'file' => [],
'script' => [
'html5_shiv' => /* enable html5 elements in older IE */,
],
]
head_link
An array of <link>
items to place in the document <head>
. Use unique keys for ease of use.
Items are provided as key => value
pairs and the values can be of type:
- string
- will assume it's a stylesheet and use the
value
as the href. - array
- an array of attribute
name => value
pairs and an additionalorder
key to determine order within the stack.
Default:
[
'base' => [
'href' => '{{theme_asset_path}}/css/base.css',
'order' => -2,
],
'iastatecss' => [
'href' => '{{theme_asset_path}}/css/iastate.css?v='. self::VERSION,
'order' => 0,
],
'favicon' => [
'rel' => 'icon',
'type' => 'image/x-icon',
'href' => '//cdn.theme.iastate.edu/favicon/favicon.ico',
],
'favicon1' => [
'rel' => 'icon',
'type' => '',
'href' => '//cdn.theme.iastate.edu/favicon/favicon.png',
],
'favicon2' => [
'rel' => 'icon',
'type' => 'apple-touch-icon',
'href' => '//cdn.theme.iastate.edu/favicon/apple-touch-icon.png',
],
'nimbus_sans' => [
'href' => '//cdn.theme.iastate.edu/nimbus-sans/css/nimbus-sans.css',
'order' => 0,
],
'font_awesome' => [
'href' => '//cdn.theme.iastate.edu/font-awesome/4.7.0/css/font-awesome.css',
'order' => 0,
],
]
head_style
An array of inline <style>
items to place in the document <head>
. Use unique keys for ease of use.
Items are provided as key => value
pairs and the values can be of type:
- string
- will use the
value
as the inline style content. - array
-
content
: content of the style elementattributes
: additional attributes to apply to<style>
order
: order of item within the stack
Default:
[]
Header
show_header
Whether to show the template header containg the dark top strip, red ribbon, and navbar.
Default: true
show_navbar_iastate
Whether to show the dark top strip containing utility links like site-wide logins, ISU index, directory, maps, etc.
Default: true
show_navbar_site
Whether to show the red ribbon containing the search bar, site nameplate, and site title and tagline.
Default: true
show_search_box
Whether to show the search box.
Default: true
search_action
The action used to submit the search form.
Default: 'http://google.iastate.edu/search'
search_client
The search client to use (Google Search specific). Set to null
to remove from form.
Default: 'default_frontend'
search_output
The search output type (Google Search specific).
Default: 'xml_no_dtd'
search_placeholder
The search input placeholder text.
Default: 'Search'
search_site
Provide a specific domain to search instead of all of iastate.edu
(Google Search specific).
Default: null
search_submit
The search button value.
Default: null
search_style
The template for the search results page (Google Search specific).
Default: 'default_frontend'
show_site_links
Whether to show the site links beneath the search bar.
Default: true
site_links
The site links to show beneath the search bar.
Format:
[
[
'label' => 'Label',
'uri' => '/route',
],
]
Default: null
show_site_title
Whether to show the site title in the red ribbon.
Default: true
site_title
The site title displayed in the left hand side of the red ribbon.
Default: null
site_url
The link to use for the site title. Set to null
to not hyperlink.
Default: ''
show_page_title
Whether to render a page title contained within an <h1>
before the page content.
Default: true
page_title
The title of the current page. Will be displayed in an <h1>
tag before the content.
Default: null
org_title
The organization title, used in the document head <title>
and for nameplate <img>
alt attributes.
Default: 'Iowa State University'
org_url
The organization URL used as the main nameplate link.
Default: 'http://www.iastate.edu/'
show_navbar_menu
Whether to show the dropdown navigation.
Default: true
navbar_menu_hover
Whether to display dropdown on hover(true
) or click(false
).
Default: true
navbar_menu_affix
Whether to affix navbar_menu to top of screen on scroll.
Default: true
navbar_menu
The navigation menu used to seed the dropdown navbar.
Format
[
[
'label' => 'Label',
'uri' => '/route',
'showchildren' => true,
'pages' => [
[
'label' => 'Level 2 Page',
'uri' => '/route#2',
],
[
'label' => 'Level 2 Submenu',
'uri' => '/route#2',
'showchildren' => true,
'pages' => [
[
'label' => 'Level 3 Page',
'uri' => '/route#3',
],
[
'label' => 'Level 3 Submenu',
'uri' => '/route#4',
'showchildren' => true,
'pages' => [
[
'label' => 'Level 4 Page',
'uri' => '/route#5',
],
[
'label' => 'Level 4 Page',
'uri' => '/route#6',
],
],
],
],
],
],
],
]
Default: null
Body
right_sidebar
The contents of the right sidebar. Setting this option will place the page content in a .col-md-9
block, and place this configuration's contents as HTML in a .col-md-4
block.
Default: null
right_nav
A configurable array that generates a list of links to anchor targets on the page and prepends it to the right_sidebar.
Format
[
[
'id' => 'target_id_1',
'label' => 'Target Label 1',
],
[
'id' => 'target_id_2',
'label' => 'Target Label 2',
'sub_targets' => [
[
'id' => 'sub_target_id_1',
'label' => 'Sub Target Label 1',
],
],
],
]
Default: null
right_nav_affix
Whether to affix the right_nav
to the top of the screen on scroll.
Default: false
right_nav_scroll_spy
Whether to add active link styling to the currently scrolled to target on the page in the right_nav
. This config by default sets right_nav_affix
to true
.
Default: false
right_nav_collapse
Whether to collapse the sub_targets
lists until the parent target is active (via scroll spy).
Default: false
show_breadcrumbs
Whether to show the route trail as linked breadcrumbs at the top of the page below the navbar menu.
Default: false
post_nav
The content to display above the container and below the navbar.
Default: null
carousel
The carousel to be drawn by calling $theme->drawCarousel()
Content Format:
[
'src' => '/img/url/imgname.jpg',
'alt' => 'Visual Description of Image',
'url' => '/route', /*image link, null for no link*/
'title' => 'Image/Link Title', /*for caption*/
'description' => 'Image/Link Description', /*for caption*/
]
Default:
[
'content' => [
/*Content arrays go in here*/
],
'show_side_buttons' => false,
'show_captions' => false,
]
Footer
show_footer
Whether to show the footer.
Default: true
footer_associates
The footer associate links. Preferably, these will be ordered from highest authority to lowest (i.e. college → department → office).
Format:
[
[
'label' => 'Associate Name',
'url' => 'http://link.to.associate',
],
[
'label' => 'IASTATE Theme',
'url' => '//theme.iastate.edu',
],
]
Default:
[]
footer_contact
The footer contact information.
Default:
[
'address' => [
'1234 Lancelot Drive',
'0001 Elaine Hall',
'Ames, IA 50011',
],
'address_url' => 'https://goo.gl/maps/89RUHcCFt652',
'email' => [
'deptaccount@iastate.edu'
],
'phone' => [
'515-294-9999'
],
'fax' => [
'515-294-9999'
],
]
show_social_labels
Whether to show the social link labels next to the icons.
Default: false
The footer social tags.
Default:
[
[
'label' => 'Facebook',
'url' => 'http://facebook.com/IowaStateU/',
],
[
'label' => 'Twitter',
'url' => 'http://twitter.com/iowastateu?lang=en',
],
[
'label' => 'Instagram',
'url' => 'http://instagram.com/iowastateu/',
],
[
'label' => 'YouTube',
'url' => 'http://youtube.com/user/iowastateu',
],
]
footer_legal
The footer legal text.
Default:
[
'statement' => 'Copyright © 1995-2025<br>
Iowa State University of Science and Technology<br>
All rights reserved',
'links' => [
[
'label' => 'Non-discrimination Policy',
'url' => 'http://www.policy.iastate.edu/policy/discrimination',
],
[
'label' => 'Privacy Policy',
'url' => 'http://www.policy.iastate.edu/electronicprivacy',
],
[
'label' => 'Digital Access & Accessibility',
'url' => 'http://digitalaccess.iastate.edu',
],
],
]
Other
full_width
Whether to make the site stretch the full width
Default: false
inline_script
A stack of <script>
items to place at the end of <body>
.
See head_script for usage instructions.
Default:
[
'file' => [],
'script' => [
'box_sizing' => /* css grid fix for older IE */,
'responsive' => function(Theme $theme)
{
if ($theme->getOption('responsive'))
{
return /* responsive design */,;
}
return null;
},
],
]
asset_path
URI path to public assets. This is for assets written by you. By default assumes all css/
, js/
etc. directories are in the www
root directory.
Default: ''
URI path to module assets. This is for assets written by you. By default assumes all css/
, js/
etc. directories are in the www
root directory.
Default: ''
theme_asset_path
URI path to public theme assets. This is for assets belonging to the theme. By default assumes all css/
, img/
etc. directories are in the www
root directory.
Default: ''
request_uri
The request URI used to match which navigation item needs to be activated. $_SERVER['REQUEST_URI']
is used if this option is null
.
Default: null
render_tags
Allows setting of functions to render elements in a specified way
Default:
[
'email' => function($str, Theme $theme)
{
list(, $email, $label) = array_pad(explode('|', $str], 3, null);
return $theme->email($email, $label);
},
]
authorization_callback
¯\_(ツ)_/¯
Default: null
route_callback
¯\_(ツ)_/¯
Default: null
translator_callback
Allows definition of a function to use for translation of a page.
For example, this function would be called if the 'translate' option is set in a navbar_menu link.
Default: null