Hide "Site Name" in ONLY front page
Permalink
Hi all! Somewhat new to c5, but I have figured out much by reading and tinkering :)
One question, though: How do I hide/not show the "Site name" area ONLY on the front page? I want all sub/other/everything else to have that logo, but just not the front page of the website.
Any ideas to edit that one specific/home/main page?
Thanks!
Nick
One question, though: How do I hide/not show the "Site name" area ONLY on the front page? I want all sub/other/everything else to have that logo, but just not the front page of the website.
Any ideas to edit that one specific/home/main page?
Thanks!
Nick
Another way to do this without creating a separate home template is to modify the page template that your home page is using already (can't say as it differs from theme to theme and site to site), and put some code like this around the thing that displays that site name:
<?php if ($c->getCollectionID() != HOME_CID): ?> //... (code that displays SITE_NAME)... <?php endif; ?>
Hi MrGrowBizz,
have followed your instructions to the letter, but no luck? Also, for reasons unknown, my Home-template isn't a full page, but a left sidebar? :-(
Any suggestions welcome - would LOVE to remove the whole header-section on my front page, so that the main-section gets hiked up to the top of the page... :-/
have followed your instructions to the letter, but no luck? Also, for reasons unknown, my Home-template isn't a full page, but a left sidebar? :-(
Any suggestions welcome - would LOVE to remove the whole header-section on my front page, so that the main-section gets hiked up to the top of the page... :-/
@jlehmann
follow jordanlev's instructions and you can do what you want do do.
And BTW home id tends to be 1.
follow jordanlev's instructions and you can do what you want do do.
And BTW home id tends to be 1.
But which CSS-file should I change? Newbie-alert here... :-)
It depends on what theme you're using -- do you know what theme it is (and if it's a built-in C5 theme or a marketplace theme or one you're building yourself)?
I'm using a modified version of Plain Yoghurt - have tried pasting your:
code into the attached home.css file.
The header2.php file that looks like this:
and is called from this home.php file:
Hope this helps clarify? Thank you again for taking the time to help a struggling n00b! :-)
<?php if ($c->getCollectionID() != HOME_CID): ?> <!-- Header goes here, you can put any HTML here. --> <?php endif; ?>
code into the attached home.css file.
The header2.php file that looks like this:
<?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 lang="<?php echo LANGUAGE?>" xmlns="http://www.w3.org/1999/xhtml"> <head> <!-- Site Header Content //--> <link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('home.css')?>" /> <link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('typography.css')?>" /> </head> <body>
and is called from this home.php file:
Hope this helps clarify? Thank you again for taking the time to help a struggling n00b! :-)
You can't put php code into css files -- only in .php files.
The most elegant solution I've seen people do is to put a different class on the body tag depending on the page type (or in your case, depending on if it's the home page or not).
For example:
Then in your stylesheet, put the .home or .not-home class in front of the style rules that you want to apply to one page or the other. Note that if you have a lot of ID's in your markup, those might override the body class (due to what's called "specificity", which can be really annoying). You might need to change your id's to classes to address this, or change the <body class="..."> to <body id="...">
Good luck!
-Jordan
The most elegant solution I've seen people do is to put a different class on the body tag depending on the page type (or in your case, depending on if it's the home page or not).
For example:
<?php if ($c->getCollectionID() == HOME_CID) { $bodyClass = 'home'; } else { $bodyClass = 'not-home'; } ?> <body class="<?php echo $bodyClass; ?>">
Then in your stylesheet, put the .home or .not-home class in front of the style rules that you want to apply to one page or the other. Note that if you have a lot of ID's in your markup, those might override the body class (due to what's called "specificity", which can be really annoying). You might need to change your id's to classes to address this, or change the <body class="..."> to <body id="...">
Good luck!
-Jordan
Hehehe...I feel like a two-year old being taught physics by Albert Einstein... ;-)
I'm sure what you're sketching out is a completely fabulous solution! Unfortunately, my vocabulary and my toolbox are severely lacking the understanding or the tools to implement it? Oy vey.
I'll bookmark this and return once I'm smarter... :-)
I'm sure what you're sketching out is a completely fabulous solution! Unfortunately, my vocabulary and my toolbox are severely lacking the understanding or the tools to implement it? Oy vey.
I'll bookmark this and return once I'm smarter... :-)
My apologies... I thought you meant you knew html/css, but not so much php.
If you can re-explain exactly what it is you want to change, I could probably tell you what to change in the built-in Plain Yogurt theme (assuming it's a simple change). But you will have to figure out yourself how to put that into your "modified version" of it.
If you can re-explain exactly what it is you want to change, I could probably tell you what to change in the built-in Plain Yogurt theme (assuming it's a simple change). But you will have to figure out yourself how to put that into your "modified version" of it.
These were great suggestions! Thanks!
1)If you have not done so already, first copy your theme to your root/theme file. If you rename it you will need to active it in the themes dashboard when you are done.
2)Copy and rename the page php file you will want for the home page. If you want full_view than copy and rename the full_view .php file. I use home.php
3)Copy and rename the main.css file, I use the name home.css
4)Copy and rename the header.php file (in root/theme/elements). I use the name header2.php.
5)Now you need to make some minor edits within each of the files you created.
home.php file edits
1)change header.php to header2.php (line 3 as noted below)
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$this->inc('elements/header2.php'); ?>
header2.php file edits
1)edit line 8, change ‘main.css’ to ‘home.css’
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('home.css')?>" />
2)edit (don’t know what line) change ‘my_site_name’ to ‘site_name_blank’
Block::getByName('site_name_blank');
home.css file edits
1) make any edits that will only pertain to you home page, the nice thing about this is you can make any css edits they will only apply to the home page.
Once complete with the edits you will need to inspect your theme under the dashboard theme tab and select the home default page type you created to add it to your theme. If you renamed your theme, you will need to activate it and do the same.
Then go to your home page edit/design and select the home page template that you created.