How to change the page title format.
From the demo gallery, I find the it use "|" as separate
<title>America | Demo | Piwigo.org</title>
Where my gallery using "/"
<title>香港體育運動照片 / 香港馬拉松相片 / 香港馬拉松2013相片 | 香港圖片庫</title>
Also, how the change the order of Album Name, Category Name and Gallery Name?
Piwigo 2.5.1
Offline
Hi :-)
You can use [extension by ddtddt] Title
or make template modele file header.tpl
line 17
remplace
<title>{if $PAGE_TITLE!=l10n('Home') && $PAGE_TITLE!=$GALLERY_TITLE}{$PAGE_TITLE} | {/if}{$GALLERY_TITLE}</title>
by
<title>{if $PAGE_TITLE!=l10n('Home') && $PAGE_TITLE!=$GALLERY_TITLE}{$PAGE_TITLE} / {/if}{$GALLERY_TITLE}</title>
Offline
Thanks, but any docs to show how to use Title plugin?
Does it support only support constant text? Any system variable supported?
Offline
Hi :-)
With plugin title, you can change title for all photo, album, page contact, page additional, and special page
What would you want on title tag ?
Offline
For Album Pages, I want to use following syntax.
%Sub Album Name% - %Gallery Name%
For Photo Pages:
%photo title% - %Sub Album Name% - %Gallery Name%
Is it possible?
Offline
hkdigit wrote:
For Album Pages, I want to use following syntax.
%Sub Album Name% - %Gallery Name%
For Photo Pages:
%photo title% - %Sub Album Name% - %Gallery Name%
Is it possible?
Yes is possible with a new plugin
Offline
When the *new* plugin will release?
Offline
Hi :-)
You can test to personal plugin
<?php
/*
Plugin Name: Titlehkdigit
Version: auto
Description:
Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
Author: ddtddt
Author URI: http://piwigo.org/
*/
if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
global $prefixeTable, $template;
define('TITLEHK_DIR' , basename(dirname(__FILE__)));
define('TITLEHK_PATH' , PHPWG_PLUGINS_PATH . TITLEHK_DIR . '/');
//prefiltre for change <title>
add_event_handler('loc_begin_page_header', 'plug_Titlehk', 56 );
function plug_Titlehk()
{
global $template;
$template->set_prefilter('header', 'plug_TitlehkP');
$PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
if($PAED['state'] == 'active') add_event_handler('AP_render_content', 'get_user_language_desc');
}
function plug_TitlehkP($content, &$smarty)
{
$search = '#<title>.*?</title>#';
$replacement = '<title>{$PERSO_TITLEHK}</title>
';
return preg_replace($search, $replacement, $content);
}
// no empty !
add_event_handler('loc_begin_page_header', 'plugTitlehk', 61);
function plugTitlehk()
{
global $template, $conf;
$titlehk = & $conf['gallery_title'];
if (!empty($titlehk))
{
$template->assign('PERSO_TITLEHK', $titlehk);
}
}
//use title on photo page
add_event_handler('loc_begin_page_header', 'TitlehkPhoto', 76 );
function TitlehkPhoto()
{
global $template, $page, $conf;
if ( !empty($page['image_id']) )
{
$query = '
select id,name
FROM ' . IMAGES_TABLE . '
WHERE id = \''.$page['image_id'].'\'
;';
$result = pwg_query($query);
$row = pwg_db_fetch_assoc($result);
$titlehk1=$row['name'];
$query = '
select id,name
FROM ' . CATEGORIES_TABLE . '
WHERE id = \''.$page['category']['id'].'\'
;';
$result = pwg_query($query);
$row = pwg_db_fetch_assoc($result);
$titlehk2=$row['name'];
$titlehk3 = & $conf['gallery_title'];
$titlehkP = $titlehk1 ." - ". $titlehk2 . " - " . $titlehk3;
$titlehkPED=trigger_event('AP_render_content', $titlehkP);
if (!empty($titlehkPED))
{
$template->assign('PERSO_TITLEHK', $titlehkPED);
}
}
}
// use title on album page
add_event_handler('loc_begin_page_header', 'Titlehkalbum', 71 );
function Titlehkalbum()
{
global $template, $page, $conf;
if (!empty($page['category']['id']) )
{
$query = '
select id,name
FROM ' . CATEGORIES_TABLE . '
WHERE id = \''.$page['category']['id'].'\'
;';
$result = pwg_query($query);
$row = pwg_db_fetch_assoc($result);
$titlehk2=$row['name'];
$titlehk3 = & $conf['gallery_title'];
$titlehkA = $titlehk2 . " - " . $titlehk3 ;
$titlehkAED=trigger_event('AP_render_content', $titlehkA);
if (!empty($titlehkAED))
{
$template->assign('PERSO_TITLEHK', $titlehkAED);
}
}
}
?>
Offline
ddtddt, Great Thanks!
However, I don't know how to use it.
Just save the file as Titlehkdigit.php and upload to /plugins folder? Please kindly advise.
Offline
Hi :-)
Go to Administration -> Plugins -> Manage
activate [extension by Piwigo Team] LocalFiles Editor
Go to Administration -> Plugin -> Local File editor -> Tab 'personal plugin'
Paste code
Go to administration -> Plugins -> Manage
activate personal plugin
Offline
Hi ddtddt,
Will the personal plugin available to public (i.e. Can down and install inside Piwigo). As I am try to deploy several copy of Piwigo and afraid to mess up by updating the Local File.
Many thanks in advance.
Offline
Hi :-)
You can create a plugin and add by FTP ;-)
Offline
I am not smart as you, can you tell me more details... or official publish to public under your professional support ;^)
Offline
Hi :-)
By FTP download folder 'PersonalPlugin' (in plugins) on you computer
Rename by Titlehkdigit
edit file main.inc.php
Rename PersonalPlugin by Titlehkdigit
you can add you plugin in folder plugins on other piwigo and active
Offline
Hi, ddtddt
Thanks! It's working!
Merci beaucoup. :)
Offline