WebsiteBaker Support (2.8.x) > Templates, Menus & Design

Hide page title

(1/1)

Tinke:
Hello everybody!
I have small problem. I would like to hide the title, image gallery pages.
But how?


--- Code: ---<?php
$path_parts = pathinfo($_SERVER[&#39;REQUEST_URI&#39;]);
if ($path_parts[&#39;dirname&#39;]=="/pages/gallery")
  echo "NO TITLE";
else
echo &#39;<div class="title">&#39;.page_title(&#39;&#39;,&#39;[PAGE_TITLE]&#39;).&#39;</div>&#39;;
?>
--- End code ---

This code make to image gallery pages "no title" and every other pages this html code

--- Code: ---My page title<div class="title"></div>
--- End code ---
But html-code should be this

--- Code: ---<div class="title">My page title</div>
--- End code ---

What i am doing wrong  :? :? :? :? :? :? :? :? :? :? :x :x :x :x :x
Please help meeeeeeeee.

Regards,
Tinke

DarkViper:
try this


--- Code: ---<?php
if( strpos( $_GLOBALS[&#39;wb&#39;]->page[&#39;link&#39;], &#39;/gallery&#39; ) == 0 )
{
    echo &#39;NO_TITLE&#39;;
}
else
{
    echo &#39;<div class="title">&#39;.PAGE_TITLE.&#39;</div>&#39;;
}
?>
--- End code ---

dfhectik:
unfortunatley that echo's NO_TITLE instead of the title.

Perhaps use page id's.
I have a page that i dont want to display any title on, but on all other pages i want to display the title.

i dont know php to good so my attemps just break my website.

DarkViper:

echo 'NO_TITLE';

'NO_TITLE' is a synonym for a hardcoded title-string only....
you can replace the text between the apostrophs with whatever you want...  also leave it empty like '' too.

Navigation

[0] Message Index

Go to full version