Im使用菜单块。即使ive将“块标题”设置为,块的标题仍然在页面上创建。标题似乎是菜单的路径。

如何删除标题?
谢谢

注释

chrisparsons的图片

尝试把块作为标题。通常会解决它。

否则,你总是可以尝试用CSS隐藏它,即使有很多原因,你不想这样做。

chrisparsons的图片

你是什​​么意思,“尝试把块作为标题。我认为id已经做到了这一点。

chrisparsons的图片

我很抱歉!

尝试将<none>放入块标题。

chrisparsons的图片

Ive已经做了。

如果我给块菜单的标题,那么该标题出现。如果我将其设置为,则它所代表的分类术语名称出现。

奇怪的是,顶级菜单不显示它的标题(这是我想要的)。后续菜单具有它们所属的分类术语术语的标题。

joelsteidl的图片

我有同样的问题。我已经添加,它仍然显示标题。这是怎么回事?<none>

chrisparsons的图片

同样的问题

chrisparsons的图片

这里可能有一些混乱。

创建自定义菜单时,必须在“站点构建”>“菜单”>“添加菜单”中为该菜单提供标题。
你可以输入任何你想要的标题...只是为了管理目的。(所以它不是你必须放在<无>)

一旦你创建了菜单,它实际上创建了一个块。
现在,在您的网站构建>块>列表中,转到刚刚创建的菜单块,然后点击配置...现在,将块标题(它首先为空)更改为<none>(没有空格)。

标题现在消失了。

其背后的逻辑:
就像我说的,当你创建一个自定义菜单,Drupal的实际上创建了一个块。所以block.tpl.php被调用。
在我的情况下,我的菜单的名称是“MAIN”,所以我的候选模板文件是block-menu-menu-main.tpl.php

如果我把block.tpl.php和打开它有一个部分说:

if ($block->subject):

print $block->subject

endif;

这些是打印出标题的行。
你总是可以删除这些行(即使上述方法删除标题应该工作),以确保摆脱标题。

完成后,将您的文件保存到block-menu-menu-main.tpl.php在您自己的主题目录。
空缓存等。

如果它仍然不为你们工作,让我知道,很高兴帮助。

chrisparsons的图片

如果你把你的菜单块一个面板,面板上的阻止设置将让您覆盖与块标题但这不是在块配置上做的。它是通过面板接口完成的。在Panel显示中的每个菜单块上选择“设置”,然后选中“覆盖标题”。对不起,这不会帮助任何人不使用面板,但如果你是,它应该为你工作。<none>

johndtaylor的图片

正是我在寻找!


 

Im using Menu Blocks. Even though ive set the ‘Block Title’ to , a title of the block is still created on the page. The title seems to be the path of the menu.

How can I remove the title?
Thanks

 

Comments

chrisparsons的图片

Try putting as the title of the block. Usually that will resolve it.

Otherwise, you can always try hiding it with CSS, even though there are many reasons why you wouldn't want to do that.

chrisparsons的图片

What do you mean by 'Try putting as the title of the block.'? I thought id already done this.

chrisparsons的图片

My apologies!

Try putting <none> in the block title.

chrisparsons的图片

Ive done that already.

If I give the block menu's a title, then that title appears. If I set it to , then the name of the taxonomy term it represents appears.

The weird thing is the top level menu doesn't show its title (which is what I want). Subsequent menus have the title of the taxonomy term they are under.

joelsteidl的图片

I'm having the same issue. I've added <none> and it is still displaying a title. What's the deal?

chrisparsons的图片

same issue here

chrisparsons的图片

there may be some confusion here.

When you create a custom Menu , you have to give that menu a title in Site Building > Menus > Add Menu.
You can enter whatever title you want in there ... that's just for admin purposes. (so it's not there you have to put in < none >)

Once you created your menu, that has in fact created a Block.
So now , in your Site Building > Blocks > List go to the Menu Block you just created and hit Configure ... now, there, change the Block title (it's empty at first) to < none > (without the spaces).

Title shoud be gone now.

Logic behind it:
Like I said, when you create a custom menu, Drupal in fact creates a block. so block.tpl.php is called.
In my case, the name of my menu is "MAIN" , so my candidate template file is block-menu-menu-main.tpl.php

If I take block.tpl.php and open it up there is a part that says:

if ($block->subject):

print $block->subject

endif;

Those are the lines that print out the title.
You could always remove those lines (altho the above mentioned method to remove the title should work) to be sure to get rid of the title.

After you've done that save your file to block-menu-menu-main.tpl.php in your own themes dir.
Empty Cache et voila.

If it still doesnt work for you guys , let me know , be glad to help.

chrisparsons的图片

If you put your Menu Block in a Panel, the Block Settings on the Panel will allow you to override the block title with <none>. But this is not done on the Block configuration. It is done through the Panels interface. Choose "Settings" on each Menu Block inside a Panel display, then check "Override title." Sorry, this doesn't help anyone not using Panels, but if you are, it should work for you.

johndtaylor的图片

Just what I was looking for!



来自  https://www.drupal.org/node/673718