Posted by bamban on
I created a views However it comes with empty <title>
tag when I set a title on views edit page, it prints out the title on custom views page. I don't want to show up the title on views page but <title>
tag should be set with what I write on edit page. I searched on the forum and some people offer that it can be achieved by adding display:none class but I don't want to use that method becasue of google doesn't like using display:none and it would flag as spam the approach how can I achieve this without adding css class ?
Comments
Use a view override
You can create a view override for this specific view by editing the view in the admin interface. Click on theme:Information to see which override will work best for you. Copy the code, create the file on your server, using one of the file names that is listed in the theme:Information section. Once you're in that file you can remove your
<h1></h1>
and place the variable that is inside the<h1>
into the<title></title>
. This is just a very basic overview of how you could go about doing it. I hope this helps.Log in or register to post comments
Thank you for your answer :)
Thank you for your answer :) I have already dug the theme information but It seems theming feature doesn't give us control by editing page title and
<title>
I haven't found solution yet :(
Log in or register to post comments
drupal_set_title() can set /
drupal_set_title() can set / change the title of the page
--------------------------------------------------------------------------------------------------------
if you can use drupal why use others?
VicTheme.com
Log in or register to post comments
Thank you for the answer.
Thank you for the answer. This solution didn't work for me :) I could set a page title with the function but also the function printed out what I set into the function. I just want to set without printing on views page
Log in or register to post comments
is this really hard in
is this really hard in drupal :D I have been wating for days for the issue
Log in or register to post comments
A workaround is to update the
A workaround, if your view is on a specific page, is to hide the title with template.php by checking the URL in the page preprocessor.
Say you want to hide the title on "http://mydomain.com/gallery"
Log in or register to post comments
Page Title module
You can have different page titles and
<title>
tags with this module: http://drupal.org/project/page_titleYou can change node titles, views titles, you can set default titles using tokens, etc.
Log in or register to post comments
A CSS fix
The Views block title tends to be a H2-header (at least in the theme I am using) in a div with id="block-views-XXXXXX"
Simply hide these annoying H2s by adding this to your theme style.css og another stylesheet if you have made one:
div[id^='block-views-'] h2
{
display:none;
}
Log in or register to post comments
I left it blank
I don't know if is the correct way, but I directly left it blank, and so far seems like working.
Log in or register to post comments
Worked for me - thanks
I just went back and edited my views by deleting the title but retaining the menu links, etc. Seems to be the least complicated solution :)
Log in or register to post comments
来自 https://www.drupal.org/forum/support/theme-development/2011-08-31/how-do-i-hide-page-title-of-a-view