Loading...
 
Features / Usability

Features / Usability


Remove page title

posts: 2

Hello,

Is there a possibility to remove page title on specific pages? Because I want all pages have the page title by default, however I would like to remove it for several specific pages.

In admin->wiki page it is possible to set this globally by checking 'Show page title'. When I searched the templates, the page title is controlled by the variable $feature_page_title. Maybe there is some way to set inside the wiki-page this variable to 'n'? Or some other way to manually remove the page title?

Thanks in advance

posts: 84

I am wondering the same thing as krienas. Now that five years have passed, is there a way to turn on "Display page name as page title" and then disable that feature on specific pages. It seems like there ought to be some way to do this.

By the way, I am using tiki 5.x



posts: 84

Rick,

I tried out your suggestion and must have done something incorrectly because now my site is not working. I can view the header and login area of pages of the site, but nothing else shows up. Therefore, I cannot undo whatever it is I did. I did try to find the file with the code I added (by looking at the source files in my website host account) so I could remove it, but couldn't find it. I looked in the templates/tiki-admin-include-look.tpl file, which appears to be the file for the Look and Feel page, but the code I had added to the custome center section wasn't there.

Do you know where I can find the code so I can undo what I did?

Thanks

posts: 84
Thank you! That did it. At first I didn't think it was working because my website wasn't fixed after either refreshing the webpages nor logging out and back in. But looking at your example gave me the idea that maybe I had to close the window and reopen it — that did the trick.

posts: 84
Thank you! That did it. At first I didn't think it was working because my website wasn't fixed after either refreshing the webpages nor logging out and back in. But looking at your example gave me the idea that maybe I had to close the window and reopen it — that did the trick.

posts: 84

Going back to the original question:

Your solution works for displaying page names on individual pages. However, I'd have to know the page name before the page is created.

What I am wanting is to have the page name display as the default, with the ability to turn it of on specific pages. For example, I created a wiki structure and want website users to be able to add pages to the structure and have the page name automatically appear as the title on the page. However, there are other pages (such as the home page) where I do NOT want the page name to appear on the page.

From the wiki administration page >> General preferences tab, there is a setting called "Display page name as page title" and "Display page name above page". Is there a way to enable these — so that they are the default — and then disable them on individual pages? Perhaps by going into the source files and change some code on the indivdual pages (although I'd rather have a way to do it directly through tiki itself). If so, how do I find the source file for the page and what code should be edited?

Or is there a more elegant way to do this?

posts: 4656 Japan

All the wiki pages are displayed using the same code, so the options like "show page title" are applied to all pages equally. Another way of looking at it is that the page-display code doesn't know what page it's displaying; it just shows the page according to how the wiki admin options are set.

To have page-specific exceptions to rules, you can use CSS, since each page has a CSS id (html id="page_n" where n is the page's ID number). Of course, the CSS rule has to have the "n" specified for pages you want it applied to.

Categories could also be used to do this, something like "if Category = n, apply the CSS rule that stops display of pagetitle", as long as you categorize each page the rule needs to apply to.

Conceivably the page-display code could be modified to not show the page title on certain pages, but what would be the filter for this? If it's based on existing data, like page names or a category, that'd work, but I don't know how you'd specify a filter that would work for pages that haven't been created or categorized yet.

Kind of on a tangent, but what some Tiki sites do is not display the page title at all, and instead use an h1 heading at the top of the wiki page (part of the wiki content). This gives you the freedom to use the heading or not on any particular page, but also requires some discipline by authors about keeping the page format consistent.

-- Gary


posts: 84

I like the CSS idea combined with using categories. That means I only have to change the CSS once, and then can easily set the correct category for the pages where I don't want the title to appear.

I am using the Strasa template. I think the following is the CSS code I'd want to modify:

Copy to clipboard
h1.pagetitle a h1.pagetitle a:visited h1.pagetitle a:hover a.pagetitle a.pagetitle:visited a.pagetitle:hover color................. : #000 text-decoration....... : none


Am I right?

The next question, then is how to change the code. Would I add a line something like this? If not, what code would I use?

Copy to clipboard
pagetitle.CategoryName diplay ....... : none


By the way, your comment is basically what I was planning to do on the pages where I don't want the page name to automatically appear as a page title.

Thanks again,

posts: 4656 Japan

Sorry, but it's a little more complicated than that. The CSS file itself doesn't get modified, since it just has rules for the normal page title display. If the no-title pages applied a special CSS class to .pagetitle when it isn't to display, then there could be the appropriate CSS rule for it, but this isn't the case; the class is always the same. So the logic for filtering to produce a not-normal display (i.e., .pagetitle {display: none}) has to happen outside the CSS file.

At this link - http://doc.tikiwiki.org/Category+Admin#Using_the_current_object_categories_in_a_tpl - there's an example of filtering by category. Instead of {menu id=50}, you would put the Smarty filter and CSS rule for the special case.

Copy to clipboard
{if isset($objectCategoryIds) and in_array(54, $objectCategoryIds)} {literal}<style type="text/css"> .pagetitle {display: none})</style>{/literal}{/if}


and this would go in the Look & Feel Admin page's custom HTML head code textarea (or the custom CSS textarea under the Miscellaneous tab, in Tiki 5.

-- Gary

posts: 84

Gary,

That worked like a charm. Thank you! I don't think I would have figured that out by myself.

For those who are reading this after me, you'll need to turn on the "Categories used in templates" feature from Admin >> Categories, if yo haven't already. In the code, replace "54" with the ID of the category you are using to indicate that the page title should not show.

And I removed an unpaired parenthesis from the code and added a ";" after the word "none". Don't know if that was necessary.

Gary, thank you again a million times!


posts: 72 United States

I know this is an oldie, but I just made this work on my Tiki9.2 site and wanted to add a note in case someone else ran into the same issue as me.

You have to replace the "&lt;" and "&gt;" in the code with < and > respectively.

This was probably obvious to someone with more experience than myself, but may help out another beginner like me.

Thanks to brandanhadlock and chiba guy for this cool trick!