Posted by Aren Cambre on November 22, 2009 at 8:32pm
14 followers
| Project: | Drupal core |
| Version: | 8.x-dev |
| Component: | base system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
| Issue tags: | Usability |
Issue Summary
If we specify a "Default front page" on admin/settings/site-information, that page's title shows up on the home page in both the content area and page title.
Please add a way to suppress this on the front page. I doubt many want an internal description like Purpose or Opener or whatever to be associated with their site's default page.
Comments
#1
This was inspired by the How do I hide the page title on my home page? forum topic.
#2
Perhaps it is your theme template? What theme are you using?
I think you can use CSS and/or DHTML - what is the URL of the site?
As a display issue, sometimes client-side is the easiest way.
This request sounds like a Joomla-type setting, where you can turn off the title of an article. Be glad there are better ways in Drupal.
#3
I have been Drupal for 3 years and can develop my own templates. :-)
I don't want to alter PHP code to do something so simple and probably common--and only for the default front page.
#4
Can you answer the questions in #2?
it does not matter how long you are using Drupal, if you do not know how to do this I can help you but I need to see an example
if you are able to edit your own PHP template you should be able achieve this there with some of the techniques proposed at http://drupal.org/node/247580
using CSS and/or DHTML does not alter your PHP code
I do not think this is something necessary to add as a feature in core, it is just a display option
#5
Thanks, but this is not a support request. I know I can kludge something together with PHP.
I am asking for direct core support of this feature because I believe that, like me, many would wish to have a default front page that just show's the node's div and nothing else--don't show the node title, don't alter the page title (in the HTML head section), don't show the author or timestamp, etc.
#6
Doesn't seem right to introduce this feature this late in the stage? Switching this to D8.. I doubt this is a usability issue for many.
#7
Have you considered Views? http://drupal.org/project/views
or Panels? http://drupal.org/project/panels
or Front Page? http://drupal.org/project/front
the point is that there are many ways to do what you are asking already
#8
Yes. A mere 54 steps on Panels + Views: http://drupal.org/node/206792
FrontPage: yes, it "works," but it's overkill for this simple need. I still think these basic features should be in core.
#9
Just investigated Front Page module further, and it doesn't let you promote a node to the home page. Instead, it makes you use second-class data--a field on admin/settings/front--as the front page. So I don't see this as a proper solution.
#10
Aren,
Please observe the two attachments. They show my web site's home page, in the bottom panes are the Firefox Firebug and Web Developer plugins.
The title of the top node, promoted to the front page and sticky is clearly identified by the CSS selector: div#node-2 h2
when I add this line to my CSS:
div#node-2 h2 {display: none}the title is gone
I cannot imagine an easier method to hide the title
#11
It's still affecting your page title (in the
titleelement), and it may still be picked up by search engines.Also, it's unclear how this can be used to only suppress the title on the default home page and not all other pages.
#12
Well, you asked how to hide the title of a node promoted to the front page.
Consider the differences between the code for the front page - with the h2 title within the node id div
<div id="middle-content"><div class="content-padding">
<div id="node-2" class="node sticky teaser">
<h2>
<a title="Welcome to netsperience 2.x" href="/node/2">Welcome to netsperience 2.x</a>
</h2>
<div class="content">
</div>
<div class="clear-block clear">
</div>
</div>
<div id="node-1061" class="node teaser">
</div>
<div id="node-1060" class="node teaser">
</div>
<div id="node-897" class="node teaser">
</div>
<div id="node-1057" class="node teaser">
</div>
<div id="node-1056" class="node teaser">
</div>
<div class="item-list">
</div>
<span class="clear"/>
<a class="feed-icon" href="http://feedproxy.google.com/netsperience" target="_blank">
</a>
<div style="clear: both;"/>
</div>
and directly viewing the node - where the title is above the node id div:
<div id="middle-content"><div class="content-padding">
<div id="tabs-wrapper" class="clear-block">
<h2 class="with-tabs">Welcome to netsperience 2.x</h2>
<ul class="tabs primary">
</ul>
</div>
<div id="node-2" class="node sticky">
</div>
<span class="clear"/>
<div style="clear: both;"/>
</div>
</div>
that is WHY I used the nested CSS selector to only affect the h2 title within the structure of the front page
div#node-2 h2 {display: none}You may also address the .teaser class used for the front-page excerpt - unless you are not using teasers...
Your exact code may be different, depending on your theme, which is why I asked what theme you are using.
I recommend using Firebug + Web Developer/Edit CSS for Firefox to make quick work of this situation.
#13
I see what you mean by the node-XXX ID. I see that in my own site.
Even if I suppress the title from the HTML that the browser renders on the screen, the title still makes it into the page's
titletag, search engines can still pick up the hidden text, and I still have to hack CSS files.Instead of hacking files to gives a partial solution, I'd rather have a complete solution that has the simplicity of a single checkbox in the admin interface.
#14
I think this is a good idea.
#15
Seconding. The vast majority of commercial websites - non-Drupal - don't display a title. I don't understand why something so small but important has been overlooked or can't be very easily facilitated - like the suggestion in #13. Even Automatic title generation with Automatically-generate-the-title-and-hide-the-title-field feature doesn't seem to work! So we can't even create a new content type to achieve this easily.
As far as SEO is concerned, meta tags are by far the more descriptive technique. Relying on displayed headings is an extremely limiting approach. So I cannot accept this as the justification for enforcing a title on the front page. Indeed, given the importance of meta tags for SEO, it would be far more useful to have explicit meta tag facility for front pages, or the ability to explicitly define a tag - rather than enforcing the title field!
Given that there has been specific front page functionality built into Drupal for many years, I am curious to know who thought it would be a great idea to forcibly display the page title, author, and published date/time - on EVERY front page of EVERY website - BY DEFAULT!!!
This is not a question about how to do it - because there are many ways to crack this particular nut. Rather it is a comment about how difficult it is to do it (in terms of experience needed to achieve it) - for what is really very basic, and arguably what should be default, behaviour.
Yes, ideally I should invest many many hours learning how to code in Drupal and submit a patch or create a tweak module to achieve this, but hopefully someone will read this who can do it in a couple of hours - rather than me spend time I don't have and do it in a couple of months!
#16
Reverting version and component. Tradition is new features like this go in the newest version and are backported, and this is probably an issue with the base system, not the page module.
#17
"This request sounds like a Joomla-type setting, where you can turn off the title of an article. Be glad there are better ways in Drupal"
Except that there is no better way to do this in Drupal. You are forced to resort to coding in your template or hiding it through CSS, or even using Javascript or something just to hide a title? Seriously that's Drupal snobbery at it's blindest and most absurd: the harder, more time consuming way that involves coding (ooooohh...) is better because that's the way Drupal does it---therefore it must be better because Drupal is better because that's your bias. It's like watching Republicans vote against things they voted for before because now the Democrats are voting for it, and once Obama's touched it, it's got cooties.
I use both Drupal and Joomla (as well as Wordpress), and sanely respect each for what they have to offer, their strengths and weaknesses both, and this is one area where Drupal could learn something from Joomla. Whenever you give the average user more control over basic things like this through a simple admin checkbox--- well, then, that's just better by any reasonable standard. How on earth could it not be is beyond me. Especially when Drupal devotees gloat over the areas in which Drupal does provide more control than Joomla, like finer grained ACL, pages and views and CCK, etc.,.... So, uh..... what??
#18
I think that Drupal has learned from Joomla, and the soon-to-be-released-still-in-alpha Drupal 7 will certainly be more friendly to Joomla users and developers, without sacrificing all its Drupal goodness, including a dashboard and more contextual controls.
check it out: http://acquia.com/resources/acquia-tv/making-drupal-7-simple-use-everyone
I asked if the D7 default content type "article" was chosen to engage the Joomla crowd, with an interesting response by Dries: http://netsperience.org/content/blog/drupal-7-default-content-type-artic...
and Drupal Gardens will blow away Wordpress.com http://acquia.com/resources/acquia-tv/drupal-gardens-chuck-dantonio
Drupal is social and semantic publishing done right...
#19
I agree with decibel.places. I'm an average user and was "sold" into using drupal when comparing cms. All in all I really like what I can build in it, although the majority of my time is spent searching and sifting through trial and error.
This issue is killing, I can't seem to get rid of the title on nodes promoted and made sticky to the front page. Would be nice to have a select box to "not show title" when promoting. Something w/out having to edit code. I pulled up firebug and tried the css edit, but in the end I risk more than I may gain by messing w/code.
I don't have the time to begin learning Joomla, so I'm a drupaler by default. Looking forward to watching this grow.
#20
inserted the css in the proper place and all is well.
thank you
#21
good for the title part.
what about the read more link. I think it should also be customizable per node basis
#22
again Firebug to the rescue!
use this css to hide or customize all Read more links
.node_read_more a {display: none}for a specific node insert the nid
div#node-897 .node_read_more a {display: none}another way to turn off Read more links is to make your post settings unlimited in length and avoid using the break in them
#23
There are 151,000 results in Google when searching for the words: drupal hide title front page
I've been hacking numerous themes for several different websites for the past few years and am kinda surprised this has never been addressed. Every commercial Drupal site I've seen has had a custom homepage (instead of 'node') and every single one wanted no title. You'll note that no standard commercial sites have a similar 'title' on their homepage either.
A simple option like "Hide node title on homepage" within Site Information - Front Page directly under Default Front Page would solve this issue. That would be the logical place in the admin to include this.
#24
#25
We can't add all modules & features into Core.
Drupal is over 10 years but no one make a module for it, why ? I'm interested. thinking it will be a popular module if every site needed it.
I can see some point above is you are have custom theme for the site. why not just add it into theme. theming is more flexible per site
#26
As something that is incredibly common and used on tons of Drupal sites (including Drupal.org, you'll note) making new users work by having to install a module just for something that should be a simple feature in the location noted is a bit silly.
#27
I found a solution in D7 for changing the tag on the front page. I had set the default front page to one of my nodes, and the title bar of the browser was showing something like "Today's Prices | XYZ Oil Co." rather than "Home | XYZ Oil Co."
Here is the code to add to your theme's template.php for changing it to the latter:
function mytheme_preprocess_html(&$variables) {if (drupal_is_front_page()) {
// Construct page title.
if (drupal_get_title()) {
$head_title = array(
'title' => t('Home'),
'name' => check_plain(variable_get('site_name', 'Drupal')),
);
}
$variables['head_title_array'] = $head_title;
$variables['head_title'] = implode(' | ', $head_title);
}
}
#28
Here is a patch which adds an option to the site information page allowing the user to hide the title of the content set to be on the front page.
The form needs a little wordsmithing, I didn't spend time on it. Patch works though AFAICT
#29
This looks good, however, I was thinking. Is this something that is better suited to be added to theme settings?
#30
+++ b/core/modules/system/system.moduleundefined@@ -2116,6 +2116,15 @@ function system_preprocess_block(&$variables) {
+ if (drupal_is_front_page() && variable_get('site_frontpage_hide_title') == TRUE) {
Can't we use $variables['is_front'] instead of drupal_is_front_page()?
if ($variables['is_front'] && variable_get('site_frontpage_hide_title') == TRUE) {#31
And also, I've been using
drupal_set_title('');to get rid of the front page title from the HTML title as well as the page title. Is this not a good practise?