Hello,

I'm working in my webpage with an Omega 4 subtheme and Layouts, helped with Context Omega module. They work great together, but I haven't been able to accomplish one thing: I need to change the head title of some pages, the title displayed in the browser tab, being it different of the page title. Without Layouts, I've seen that is possible to change it via page.tpl.php, but with Layouts is different, since we don't have the "head" part of the page in my layout.tpl.php code.

I have tried to change it via the page preprocess function, doing something like
$variables['head_title'] = t('Custom text');
,but didn't work. For example, if I write this
$variables['title'] = t('Custom text');
into the function, the page title changes, but I can't change the head title. Any help on this? Thanks.

EDIT: Working applying @denisha.kalariya's answer. Thanks :)

Comments

xecollons created an issue. See original summary.

Subhransu.addweb’s picture

To incorporate change in Head title, you need to try the below code for template_preprocess_html function.

function template_preprocess_html(&$variables) {
        $variables['head_title'] = " test ";
}

This worked for me. Hope that works for you too.

Thanks!

xecollons’s picture

Worked perfectly, @denisha.kalariya ! Thanks a lot :)

xecollons’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)