Functions/link to admin home page

The link_to_admin_home_page helper creates a link to the Omeka admin anywhere in your public theme.

Usage

<?php echo link_to_admin_home_page(
        $text = null, 
        $props = array() 
      );
?>

Arguments

  • text - (string) The string of text for the link. Default is null.
  • props - (array) An array of properties for the admin home page link. These are attributes and values for the <a> tag.

Example

Simple Usage

To create a link to your admin using the text "Admin" for the link, use the following:

<?php echo link_to_admin_home_page('admin'); ?>

This will generate:

<a href="http://example.com/admin/">Admin</a>

Adding Attributes to the Link

You can add attributes to the link, such as id or class, by passing those attributes to the props argument in an array:

<?php 
echo link_to_admin_home_page(
        'Admin', 
        array(
            'id' => 'admin-link', 
            'class' => 'link')
            ); 
?>

This will generate:

<a href="http://example.com/admin/" 
id="admin-link" class="link">Admin</a>

You can add any valid attribute to the link tag.