0

I'm trying to implement this: http://ryanissamson.drupalgardens.com/blog/html-node-and-view-title to add the possibility of having HTML injected in node titles. It works great for the node titles in the pages and the views.

But there's something I cannot accomplish: the "$head_title" part. I can't change the text of the title showed in the browser tab, so, assuming that I have a mid-italic title like "Title", in the browser tab it shows something like "Ti[i]tle[/i]".

I think it's because Omega 4 uses the Layout system, that works perfect, and we don't have to override page.tpl.php, as seen in How do you override page.tpl.php in Omega 4?

Here people say to this guy to disable Layouts, but for me that's not an option at this moment.

Any ideas? Thanks.

0

Changing head title for a page in Omega 4 based on node id - same approach will work for any other content. (code below goes into template.php)

Didn't test if this method supports described above HTML injection.

    function yourtheme_preprocess_html(&$variables) {
        if ($node){
        $mynodeid = $node->nid;
// this will set "Custom Title" for a node with NID = 10
        if($mynodeid == 10) {
            $variables['head_title'] = t('Custom Title');
        }
      }
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.