Showing posts with label getsimple. Show all posts
Showing posts with label getsimple. Show all posts

Tuesday, October 29, 2013

Create a GetSimple sitemap with return_i18n_menu_data function from I18N plugin

A custom sitemap can be easily generated using return_i18n_menu_data() function from I18N GetSimple plugin.

A "sidebar" component below generates a simple sitemap of a site built with GetSimple.

<h2>Sitemap</h2>

<?
$data = return_i18n_menu_data(null, 0, 99, I18N_FILTER_NONE | I18N_OUTPUT_TITLE);

foreach ($data as $item)
{
    echoItem($item, 0, '');
}

function echoItem($item, $level, $path)
{
    $offset = $level * 16;
    $title = $item['title'];
    $url = $item['url'];
    
    $path = getSiteUrl() . $path . $url;

    echo "<li style=\"margin-left: {$offset}px;\"><a href=\"$path\">$title</a></li>\r\n";

    foreach ($item['children'] as $child)
    {
        echoItem($child, $level + 1, $url . '/');
    }
}

function getSiteUrl()
{
    global $SITEURL;
    return parse_url($SITEURL, PHP_URL_PATH);
}
?>

Monday, October 28, 2013

Create a GetSimple sitemap with return_i18n_page_structure function from I18N plugin

A custom sitemap can be easily generated using return_i18n_page_structure() function from I18N GetSimple plugin.

A "sidebar" component below generates a simple sitemap of a site built with GetSimple.

<h2>Sitemap</h2>

<?
$items = return_i18n_page_structure(null, false, null);

foreach ($items as $item)
{
    $offset = $item['level'] * 16;
    $title = $item['title'];
    $url = $item['url'];

    echo "<li style=\"margin-left: {$offset}px;\"><a href=\"$url\">$title</a></li>\r\n";
}
?>

P.S. return_i18n_page_structure() function is wrongly called return_i18n_structure() in I18N plugin documentation.

"Creole Wiki Markup" GetSimple plugin

Creole Wiki Markup is a GetSimple plugin that allows to use Creole 1.0 wiki mark-up in page content.

Download it from GetSimple Extend Repository.

Plugin is based on Codeholic PHP Creole 1.0 wiki markup parser and is distributed under the MIT License.

Source code is available at GitHub: https://github.com/vurdalakov/creole_markup