Skip to content

Commit

Permalink
bug 2772: remove "Home" from html title pages on index pages
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@18637 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rvelices committed Oct 13, 2012
1 parent 1e6e762 commit 7f75c13
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
4 changes: 0 additions & 4 deletions include/config_default.inc.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -182,10 +182,6 @@
// ); // );
$conf['random_index_redirect'] = array(); $conf['random_index_redirect'] = array();


// reverse_home_title: if Piwigo is your home page for a better robot index
// we recommend to set it true (Only index page will reverse its title)
$conf['reverse_home_title'] = false;

// List of notes to display on all header page // List of notes to display on all header page
// example $conf['header_notes'] = array('Test', 'Hello'); // example $conf['header_notes'] = array('Test', 'Hello');
$conf['header_notes'] = array(); $conf['header_notes'] = array();
Expand Down
4 changes: 0 additions & 4 deletions include/page_header.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@
isset($page['body_id']) ? isset($page['body_id']) ?
$page['body_id'] : '', $page['body_id'] : '',


'REVERSE' =>
(isset($conf['reverse_home_title']) and $conf['reverse_home_title']) ?
true : false,

'CONTENT_ENCODING' => get_pwg_charset(), 'CONTENT_ENCODING' => get_pwg_charset(),
'PAGE_TITLE' => strip_tags($title), 'PAGE_TITLE' => strip_tags($title),


Expand Down
17 changes: 15 additions & 2 deletions include/section_init.inc.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -561,9 +561,22 @@
{ {
if (!empty($page['title'])) if (!empty($page['title']))
{ {
$page['title'] = $conf['level_separator'].$page['title']; $page['section_title'] = '<a href="'.get_gallery_home_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].$page['title'];
} }
$page['title'] = '<a href="'.get_gallery_home_url().'">'.l10n('Home').'</a>'.$page['title']; else
{
if ('picture'==script_basename())
{
$used_title = l10n('Home');
$used_link = duplicate_index_url(array('start'=>0));
}
else
{
$used_title = @$page['is_homepage'] ? $conf['gallery_title'] :l10n('Home');
$used_link = get_gallery_home_url();
}
$page['section_title'] = $page['title'] = '<a href="'.$used_link.'">'.$used_title.'</a>';
}
} }


// add meta robots noindex, nofollow to avoid unnecesary robot crawls // add meta robots noindex, nofollow to avoid unnecesary robot crawls
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@


$template->set_filenames( array('index'=>'index.tpl') ); $template->set_filenames( array('index'=>'index.tpl') );
//-------------------------------------------------------------- category title //-------------------------------------------------------------- category title
$template_title = $page['title']; $template_title = $page['section_title'];
if (count($page['items']) > 0) if (count($page['items']) > 0)
{ {
$template_title.= ' ['.count($page['items']).']'; $template_title.= ' ['.count($page['items']).']';
Expand Down
2 changes: 1 addition & 1 deletion picture.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ function default_picture_content($content, $element_info)


$template->assign( $template->assign(
array( array(
'SECTION_TITLE' => $page['title'], 'SECTION_TITLE' => $page['section_title'],
'PHOTO' => $title_nb, 'PHOTO' => $title_nb,
'IS_HOME' => ('categories'==$page['section'] and !isset($page['category']) ), 'IS_HOME' => ('categories'==$page['section'] and !isset($page['category']) ),


Expand Down
5 changes: 1 addition & 4 deletions themes/default/template/header.tpl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
<meta name="description" content="{$PAGE_TITLE}{if isset($INFO_FILE)} - {$INFO_FILE}{/if}"> <meta name="description" content="{$PAGE_TITLE}{if isset($INFO_FILE)} - {$INFO_FILE}{/if}">
{/if} {/if}
{/if} {/if}

<title>{$PAGE_TITLE}{if $PAGE_TITLE!=$GALLERY_TITLE} | {$GALLERY_TITLE}{/if}</title>
{if (isset($REVERSE) and $REVERSE and $PAGE_TITLE == l10n('Home'))}
<title>{$GALLERY_TITLE} | {$PAGE_TITLE}</title>{else}
<title>{$PAGE_TITLE} | {$GALLERY_TITLE}</title>{/if}
<link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}{$themeconf.icon_dir}/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}{$themeconf.icon_dir}/favicon.ico">


<link rel="start" title="{'Home'|@translate}" href="{$U_HOME}" > <link rel="start" title="{'Home'|@translate}" href="{$U_HOME}" >
Expand Down

0 comments on commit 7f75c13

Please sign in to comment.