Changing from Site Name to Logo
Permalink
Hello,
I am trying to replace the text that says "Test Site 2." with an option to include a place where the user can add a logo. I have included the code below. Also, I have attached two files. The first file will show an example of the site and the second one will outline where we would like the logo to go. Hope this makes sense. Thanks for the help!
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!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" dir="ltr" >
<head profile="http://gmpg.org/xfn/11">
<?php Loader::element('header_required'); ?>
<link rel="stylesheet" href="<?php echo $this->getThemePath()?>/style.css" type="text/css" media="screen" />
<link rel='stylesheet' id='superfish-css' href='<?php echo $this->getThemePath()?>/superfish/superfish.css?ver=1.4.8' type='text/css' media='all' />
</head>
<body class="noise grey">
<div id="wrapper">
<div id="main">
<div id="header-top-wrap">
</div>
</div>
</div>
</div>
<div id="header" class="clearfix">
<div id="logo" class="clearfix">
<h1><a href="<?php echo DIR_REL?>/"><?php
$block = Block::getByName('My_Site_Name');
if( $block && $block->bID ) $block->display();
else echo SITE;
?></a></h1>
I am trying to replace the text that says "Test Site 2." with an option to include a place where the user can add a logo. I have included the code below. Also, I have attached two files. The first file will show an example of the site and the second one will outline where we would like the logo to go. Hope this makes sense. Thanks for the help!
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!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" dir="ltr" >
<head profile="http://gmpg.org/xfn/11">
<?php Loader::element('header_required'); ?>
<link rel="stylesheet" href="<?php echo $this->getThemePath()?>/style.css" type="text/css" media="screen" />
<link rel='stylesheet' id='superfish-css' href='<?php echo $this->getThemePath()?>/superfish/superfish.css?ver=1.4.8' type='text/css' media='all' />
</head>
<body class="noise grey">
<div id="wrapper">
<div id="main">
<div id="header-top-wrap">
</div>
</div>
</div>
</div>
<div id="header" class="clearfix">
<div id="logo" class="clearfix">
<h1><a href="<?php echo DIR_REL?>/"><?php
$block = Block::getByName('My_Site_Name');
if( $block && $block->bID ) $block->display();
else echo SITE;
?></a></h1>
The "My_Site_Name" block is likely a block on your home page which is displaying the site name. Or it was there in the past. If it's not there you can place a content block and save it. Then click on the block in edit mode and click "custom template". Insert "My_Site_Name" as the block name
Hi,
Thanks for the quick response. This block still remains on the site. If I got rid of it, would I still be able to place a content block there and save it? If so, where could I find the code for it?
Thanks.
Thanks for the quick response. This block still remains on the site. If I got rid of it, would I still be able to place a content block there and save it? If so, where could I find the code for it?
Thanks.
if you just delete that block it wont display anywhere anymore. Then put whatever you want in place of it!!
I am not sure if I did this correctly, but I made this a main content area and then uploaded an image, but of course it will not display on every page. Any suggestions?
you made a new "area" in the page type? If this is the case, you should make it a "GlobalArea"...
If you could share any code you changed, links, etc., i could better understand what you're doing!
If you could share any code you changed, links, etc., i could better understand what you're doing!
This is what I have so far:
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!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" dir="ltr" >
<head profile="http://gmpg.org/xfn/11">
<?php Loader::element('header_required'); ?>
<link rel="stylesheet" href="<?php echo $this->getThemePath()?>/style.css" type="text/css" media="screen" />
<link rel='stylesheet' id='superfish-css' href='<?php echo $this->getThemePath()?>/superfish/superfish.css?ver=1.4.8' type='text/css' media='all' />
</head>
<body class="noise grey">
<div id="wrapper">
<div id="main">
<div id="header-top-wrap">
</div>
</div>
</div>
</div>
<div id="header" class="clearfix">
<div id="logo" class="clearfix">
<h1><a href="<?php echo DIR_REL?>/"><?php
//$a = new Area('Main Content');
//$a->display($c);
?></a></h1>
</div>
</div>
<div id="menu-wrap">
<div class="ts-menu-main">
<?php
$bt = BlockType::getByHandle('autonav');
$bt->controller->displayPages = 'top';
$bt->controller->orderBy = 'display_asc';
$bt->controller->displaySubPages = 'all';
$bt->controller->displaySubPageLevels = 'custom';
$bt->controller->displaySubPageLevelsNum = '3';
$bt->render('templates/header_menu_dropdown');
?>
</div>
</div>
<div id="content-top"></div>
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!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" dir="ltr" >
<head profile="http://gmpg.org/xfn/11">
<?php Loader::element('header_required'); ?>
<link rel="stylesheet" href="<?php echo $this->getThemePath()?>/style.css" type="text/css" media="screen" />
<link rel='stylesheet' id='superfish-css' href='<?php echo $this->getThemePath()?>/superfish/superfish.css?ver=1.4.8' type='text/css' media='all' />
</head>
<body class="noise grey">
<div id="wrapper">
<div id="main">
<div id="header-top-wrap">
</div>
</div>
</div>
</div>
<div id="header" class="clearfix">
<div id="logo" class="clearfix">
<h1><a href="<?php echo DIR_REL?>/"><?php
//$a = new Area('Main Content');
//$a->display($c);
?></a></h1>
</div>
</div>
<div id="menu-wrap">
<div class="ts-menu-main">
<?php
$bt = BlockType::getByHandle('autonav');
$bt->controller->displayPages = 'top';
$bt->controller->orderBy = 'display_asc';
$bt->controller->displaySubPages = 'all';
$bt->controller->displaySubPageLevels = 'custom';
$bt->controller->displaySubPageLevelsNum = '3';
$bt->render('templates/header_menu_dropdown');
?>
</div>
</div>
<div id="content-top"></div>
try replacing this:
with this:
<div id="header" class="clearfix"> <div id="logo" class="clearfix"> <h1><a href="<?php echo DIR_REL?>/"><?php //$a = new Area('Main Content'); //$a->display($c); ?></a></h1> </div> </div>
with this:
<div id="header" class="clearfix"> <div id="logo" class="clearfix"> $a = new GlobalArea('Main Content'); $a->display($c); </div> </div>
sorry, make that $a->display();
I have made the edits, this is what I am getting now (see image):
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!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" dir="ltr" >
<head profile="http://gmpg.org/xfn/11">
<?php Loader::element('header_required'); ?>
<link rel="stylesheet" href="<?php echo $this->getThemePath()?>/style.css" type="text/css" media="screen" />
<link rel='stylesheet' id='superfish-css' href='<?php echo $this->getThemePath()?>/superfish/superfish.css?ver=1.4.8' type='text/css' media='all' />
</head>
<body class="noise grey">
<div id="wrapper">
<div id="main">
<div id="header-top-wrap">
</div>
</div>
</div>
</div>
<div id="header" class="clearfix">
<div id="logo" class="clearfix">
$a = new GlobalArea('Main Content');
$a->display();
</div>
</div>
</div>
<div id="menu-wrap">
<div class="ts-menu-main">
<?php
$bt = BlockType::getByHandle('autonav');
$bt->controller->displayPages = 'top';
$bt->controller->orderBy = 'display_asc';
$bt->controller->displaySubPages = 'all';
$bt->controller->displaySubPageLevels = 'custom';
$bt->controller->displaySubPageLevelsNum = '3';
$bt->render('templates/header_menu_dropdown');
?>
</div>
</div>
<div id="content-top"></div>
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?>
<!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" dir="ltr" >
<head profile="http://gmpg.org/xfn/11">
<?php Loader::element('header_required'); ?>
<link rel="stylesheet" href="<?php echo $this->getThemePath()?>/style.css" type="text/css" media="screen" />
<link rel='stylesheet' id='superfish-css' href='<?php echo $this->getThemePath()?>/superfish/superfish.css?ver=1.4.8' type='text/css' media='all' />
</head>
<body class="noise grey">
<div id="wrapper">
<div id="main">
<div id="header-top-wrap">
</div>
</div>
</div>
</div>
<div id="header" class="clearfix">
<div id="logo" class="clearfix">
$a = new GlobalArea('Main Content');
$a->display();
</div>
</div>
</div>
<div id="menu-wrap">
<div class="ts-menu-main">
<?php
$bt = BlockType::getByHandle('autonav');
$bt->controller->displayPages = 'top';
$bt->controller->orderBy = 'display_asc';
$bt->controller->displaySubPages = 'all';
$bt->controller->displaySubPageLevels = 'custom';
$bt->controller->displaySubPageLevelsNum = '3';
$bt->render('templates/header_menu_dropdown');
?>
</div>
</div>
<div id="content-top"></div>
oops, change this:
forgot the php tags :D
<?php $a = new GlobalArea('Main Content'); $a->display(); ?>
forgot the php tags :D
It works! Thanks for the help!