By lantius on
hi,
if you to your blog in drupal 7
for example
and you don't like the title "Blogs"
You can modify it by editing the file:
Modules>Blog>blog.module
and in the section:
function blog_menu() {
$items['blog'] = array(
'title' => 'Blogs',
'page callback' => 'blog_page_last',
'access arguments' => array('access content'),
'type' => MENU_SUGGESTED_ITEM,
'file' => 'blog.pages.inc',
you can change title element of array into what you want.
Example:
function blog_menu() {
$items['blog'] = array(
'title' => 'These are the blog entries of all users in this system',
'page callback' => 'blog_page_last',
'access arguments' => array('access content'),
'type' => MENU_SUGGESTED_ITEM,
'file' => 'blog.pages.inc',
Or remove the title :
function blog_menu() {
$items['blog'] = array(
'page callback' => 'blog_page_last',
'access arguments' => array('access content'),
'type' => MENU_SUGGESTED_ITEM,
'file' => 'blog.pages.inc',
hope it helps someone
greetings
Comments
Not a good idea to modify the module
Don't modify the module, or you'll have to make that mod every time you update Drupal.
Instead, just change it at http://example.com/admin/structure/menu.
You can change the title of most menu items using the admin interface.
Doug Gough
Editing the menu will not fix this
This title can not be edited via /admin/structure/menu above
The proper way to do this is in the TEMPLATENAME_preprocess_page() function from within your theme's template.php file.
However, some interesting notes follow:
1) when I manually changed the 'Blogs' text as described above, I could not the title to change
2) editing the menu_router entry for path='blog' ALSO did not work (of course clearing the cache will reset this value to 'Blogs' based on the .module hook_menu setting if you've left this alone
3) within template.php, preprocess_page, the $vars['title'] variable is undefined
In short, using the prescribed methods, I was not able to get this to work. Additional comments would be greatly appreciated.
What I ended up doing was keying in on the $_SERVER['REQUEST_URI'] value, and manually setting $vars['title'] = 'My BLog Title'; in my preprocess_page function
Very strange
Editing breadcrumb with theme_breadcrumb($breadcrumb)
Edit the 'Blogs' title in the breadcrumb process function. Like this:
This way I got it to work, but I don't know if this is good to check title in every breadcrumb call.
@ben.hamelin I wonder why I didn't find your post before, I've been unsuccessfully trying what you said minutes before I posted this.
Think better solution
Think better solution is:
Changing the Menu Title from admin works
Changing the menu item's title from admin panel works. It changes the page title.
Muhammad.
Thankx @Bel.inna ,This worked
Thankx @Bel.inna ,This worked for me.
Just to Clarify
You need to change this in the Navigation Menu as well as the Main Menu in Drupal 7... I hope this helps to clarify for other users like me who didn't understand this at first.
String override module
This worked for me: http://drupal.org/project/stringoverrides
Read the current arg(0) variable
I have found by far the easiest method for doing this is by analyzing the current Drupal path by reading the current
arg(0)variable.see http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/arg/7
Paste this section of code at the top of your theme's page.tpl.php within PHP tags
<?php ... ?>This works for Drupal 6 and Drupal 7.
Read the $path variable
Reading the page at http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/arg/7, it does intimate that the use of the arg() variable is frowned upon in this instance although purely for readability issues.
A cleaner method would be to read the
$pathvariable as such:But String Overrides Does Not Affect Title in Browser
String Overrides does change title but the link is still @ www.mysite.com/blog
you can change that
by adding an alias in configuration / URL alias
I used string override to change the title of my Blog. Frustrating to have to use a module to do something that should be so simple - why isn't there a simple "blog settings".
At the same time, the other easy solution is so make a view that you use as the blog and give it whatever name you want.
I was a little to lazy to do that. String override worked!
i have a feeling a view will be the better solution in my case, because right now, I can't remember how to control the number of posts per page or the pager... Just seems like I have very little control over the default blog.
Generate Dynamic menu and Page title
Use this code to generate the dynamic menu title and page title.