Hi Orstio,
Can you help me with a little problem? I'm running my SMF forum wrapped in Joomla and using the bridge.
I have noticed that the meta title is not correct; every meta title tag for every post is the same (just my standard Joomla meta-title).
I need the meta title to change with each post viewed, just as it does on this site.
I tried putting <title>', $context['page_title'], '</title>
into my template but I ended up with 2 seperate title meta tags when viewed (the Joomla one and the SMF one). I can't figure out how to only call the smf title when the forum pages are viewed.
Here's my Joomal template at the moment. I'd appreciate any advice you can give.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); ?>
<head>
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.classify.org/safesurf/" L gen true for "http://www.hairdressingworld.com" r (SS~~000 6 SS~~001 1 SS~~009 1))'>
<META name="verify-v1" content="aRd5j12M3Xvjo292wR2QYGaJ3WEAjtRwV7n7fS29jyU=">
<meta name="netinsert" content="0.0.1.2.17.1">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe-> getTemplate(); ?>/css/template_css.css" rel="stylesheet" type="text/css" media="all"/>
<link rel="stylesheet" type="text/css" href="http://www.hairdressingworld.com/hairdressingforum/Themes/orange-lt02/style.css?rc3" />
<link rel="stylesheet" type="text/css" href="http://www.hairdressingworld.com/hairdressingforum/Themes/default/print.css?rc3" media="print" />
<link rel="shortcut icon" href="<?php echo $mosConfig_live_site;?>/images/favicon.ico" />
<?PHP if(file_exists($mosConfig_absolute_path."/components/com_tfsforjoomla/tfsforjoomla.php"))
{
require_once($mosConfig_absolute_path."/components/com_tfsforjoomla/tfsforjoomla.php");
}?>
<?php
if ( $my->id ) { initEditor(); }
mosShowHead();
?>
</head>
<body>
<?PHP
if(file_exists($mosConfig_absolute_path."/components/com_joomlastats/joomlastats.inc.php"))
{
require_once($mosConfig_absolute_path."/components/com_joomlastats/joomlastats.inc.php");
}
?>
<div id="top">
<div class="rights">
<div id="search">
<?php mosLoadModules ('user4'); ?>
</div>
</div>
<div class="lefts">
<div class="padding">
<h1><?php echo $mosConfig_sitename; ?></h1>
<h2>Hairdressing Jobs, News & Forums!</h2>
</div>
</div>
</div>
<div class="content">
<div id="main">
<div id="topmenu">
<div class="rights"><?php mosLoadModules ('translate'); ?></div>
<div class="lefts"><?php mosLoadModules ('user3'); ?></div>
</div>
<div id="newsflash">
<div class="rights"></div>
<div class="lefts"></div>
</div>
<div class="padding">
<?php
if (mosCountModules('left') && mosCountModules('right')) { ?>
<div id="left_side">
<div class="lefts">
<?php mosLoadModules('left'); ?>
</div>
</div>
<div id="mosright"><?php mosLoadModules('right'); ?></div>
<div id="right_side2">
<div class="banner"><center><?php if (mosCountModules('banner')) { mosLoadModules('banner'); } ?></center></div>
<?php mosMainBody(); ?>
<?php } elseif (mosCountModules('left')) { ?>
<div id="left_side">
<div class="lefts">
<?php mosLoadModules('left'); ?>
</div>
</div>
<div id="right_side_wide"> <?php mosMainBody(); ?> </div>
<?php } else {?>
<div id="right_side_full"><?php mosMainBody(); ?> </div>
<?php } ?>
</div>
<?php /* Top user5, user6 and user7. */
if(mosCountModules('user5') && mosCountModules('user6') && mosCountModules('user7')) { ?>
<div id="modules">
<div class="lefts"></div>
<div class="mod_user7"> <?php mosLoadModules ('user7');?> </div>
<div class="mod_user5"> <?php mosLoadModules ('user5');?> </div>
<div class="mod_user6"> <?php mosLoadModules ('user6');?> </div>
</div></div>
<?php } else {?>
<div id="clearb"></div></div>
<?php } ?>
</div></div>
<div id="footer">
<div class="rights"></div>
<div class="lefts">
<div class="padding">Copyright © 2006 HairdressingWorld.com- <a href="http://www.joomladesigns.co.uk/">Joomladesigns</a> - <a href="http://www.joomladesigns.co.uk/">Joomla Templates</a></div>
</div>
</div>
<!-- Start of StatCounter Code -->
<script type="text/javascript">
<!--
var sc_project=1534378;
var sc_invisible=1;
var sc_partition=14;
var sc_security="0dc1c71e";
//-->
</script>
<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script><noscript><div class="statcounter"><a class="statcounter" href="http://www.statcounter.com/"><img class="statcounter" src="http://c15.statcounter.com/counter.php?sc_project=1534378&java=0&security=0dc1c71e&invisible=1" alt="web statistic" /></a></div></noscript>
<!-- End of StatCounter Code -->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-531986-3";
urchinTracker();
</script>
<?php mosLoadModules( 'debug', -1 );?>
<?php mysql_select_db($GLOBALS['db_name']); ?>
</body>
</html>
Thanks for your help Orstio.
Add this before mosShowHead();
if(!empty($context['page_title']))
$mainframe->setPageTitle($context['page_title']);
Thanks Orstio, that worked a charm!