Is there any way to change the description and add keywords on the meta-head in the index?
Offline
For change keywords on the meta-head you can use [extension by ddtddt] Meta
Offline
For 'home' of the <title> you want to put something else instead or just remove 'home'
Offline
On the META HEADS title and description are the same..
example:
<title>Home / Carnevale di Venezia</title>
<meta name="description" content="Home / Carnevale di Venezia">
it is possible that the description of the category or the album will be like the individual photos?
like this (example):
<title>Carnevale di Venezia</title>
<meta name="description" content="Fotografie del Carnevale di Venezia del 2009, 2008 e 2007. Documentazione dei costumi e delle maschere.">
- I tried to change the "Templates" as indicated by LucMorizur, then the problem is that all pages of the photos will all have the same title and description with the result of being penalized by search engines
- the plugin "Meta" that you suggested add the same description in all pages.
would be very important that the most important page of the platform can be modified (title, description and keywords)
* My opinion is that "Home /" should be removed from the meta
Home is an indication and not a title! That indication might confuse the search engines to the main content of an album or category
Offline
Can you test
add_event_handler('loc_end_page_header', 'simptitle' );
function simptitle ()
{global $template, $page, $title2, $conf;
$title2 = array();
$title2['page'] = $template->get_template_vars('PAGE_TITLE');
$array = explode($conf['level_separator'], $title2['page']);
$count = count($array);
if (!empty($array[$count-1]))
{
$template->assign('PAGE_TITLE', $array[$count-1]);
}
}
Offline
thanks, can you tell me where to place the code
Offline
With plugin LocalFilesEditor tab 'personal plugin'
(you must active and install personal plugin)
Offline
I tried to upload the code that you gave (see attached image) but the platform crashes :-(
Last edited by sergix (2010-10-21 11:40:59)
Offline
Can you give me link by e-mail
Offline
We must put the code in the tab 'Personal plugin'
Offline
sergix wrote:
Done! But I see no changes :-(
have you install and active plugin ?
Offline
For the purposes of the description tag, I suggest you [Forum, topic 116691]
Offline
If I understand your request
a plugin for you
(you must desactive meta/metasimple ans simpletitle)
<?php
/*
Plugin Name: sergix
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!');
add_event_handler('loc_begin_page_header', 'Change_sergix',10 );
add_event_handler('loc_end_page_header', 'gensergix',53);
add_event_handler('loc_end_page_header', 'sergixacc',55);
add_event_handler('loc_end_page_header', 'sergixcat',60);
add_event_handler('loc_end_page_header', 'sergiximg',70);
add_event_handler('loc_end_page_header', 'set_sergix_back',80);
function Change_sergix()
{
global $template;
$template->set_prefilter('header', 'upmatasergix');
$template->set_prefilter('header', 'uptitlesergix');
}
function upmatasergix ($content, &$smarty)
{
$search = '#<meta name="description" content=".*?">#';
$replacement = '<meta name="description" content="{$SERGIX_META}">';
return preg_replace($search, $replacement, $content);
}
function uptitlesergix($content, &$smarty)
{
$search = '#<title>.*?</title>#';
$replacement = '<title>{$SERGIX_TITLE}</title>';
return preg_replace($search, $replacement, $content);
}
function gensergix()
{
global $template, $page, $conf;
$titlegen = & $conf['titlesergix'];
if (!empty($titlegen))
{
$template->assign('SERGIX_TITLE', $titlegen);
}
else
{
$titlegen = & $conf['gallery_title'];
$template->assign('SERGIX_TITLE', $titlegen);
}
}
function sergixacc()
{
global $template, $page, $meta_infosdesc, $conf;
$meta_infosdesc = array();
$meta_infosdesc['info'] = $template->get_template_vars('INFO_FILE');
$meta_infosdesc['page'] = $template->get_template_vars('PAGE_TITLE');
$meta_infosdesc['comment'] = $template->get_template_vars('COMMENT_IMG');
$meta_infos['title'] = $template->get_template_vars('GALLERY_TITLE');
if (isset($page['section']) and $page['section'] == 'categories' and empty($page['category']['id']))
{
$titleindex = & $conf['titleexgix_accueil'];
$template->assign('SERGIX_TITLE', $titleindex. ' - ' .$meta_infos['title']);
$descindex = & $conf['metasergixacc'];
$template->assign('SERGIX_META', $descindex);
}
}
function sergixcat()
{
global $template, $page, $meta_infosdesc, $conf;
$meta_infosdesc = array();
$meta_infosdesc['info'] = $template->get_template_vars('INFO_FILE');
$meta_infosdesc['page'] = $template->get_template_vars('PAGE_TITLE');
$meta_infosdesc['comment'] = $template->get_template_vars('COMMENT_IMG');
$meta_infos['title'] = $template->get_template_vars('GALLERY_TITLE');
if (!empty($page['category']['id']) )
{
$query = '
select id,name,comment
FROM ' . CATEGORIES_TABLE . '
WHERE id = \''.$page['category']['id'].'\'
;';
$result = pwg_query($query);
$row = mysql_fetch_array($result);
if (!empty($row['name']))
{
$template->assign('SERGIX_TITLE', $row['name']);
}
if (!empty($row['comment']))
{
$template->assign('SERGIX_META', $row['comment']);
}
}
}
function sergiximg()
{
global $template, $page, $meta_infosdesc, $conf;
$meta_infosdesc = array();
$meta_infosdesc['info'] = $template->get_template_vars('INFO_FILE');
$meta_infosdesc['page'] = $template->get_template_vars('PAGE_TITLE');
$meta_infosdesc['comment'] = $template->get_template_vars('COMMENT_IMG');
$meta_infos['title'] = $template->get_template_vars('GALLERY_TITLE');
if ( !empty($page['image_id']) )
{
$query = '
select id,name,storage_category_id
FROM ' . IMAGES_TABLE . '
WHERE id = \''.$page['image_id'].'\'
;';
$result = pwg_query($query);
$row = mysql_fetch_array($result);
if (!empty($row['name']))
{
$template->assign('SERGIX_TITLE', $row['name']. ' - ' .$meta_infos['title']);
}
else
{
$template->assign('SERGIX_TITLE', $meta_infosdesc['info']. ' - ' .$meta_infos['title']);
}
$descindex = & $conf['metasergixacc'];
$template->assign('SERGIX_META', $descindex.' - ' .$row['name']);
}
}
function set_sergix_back()
{
global $template, $meta_infosdesc;
$template->assign
(array
(
'INFO_FILE' => $meta_infosdesc['info'],
'COMMENT_IMG' => $meta_infosdesc['comment']
)
);
}
?>
Offline
for personal title
with local file editor
$conf['titlesergix']='your personal title';
Offline