TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,242
  • Total Topics: 21,353
  • Online today: 192
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 149
  • Total: 150
  • lurkalot

Index title?

Started by OIDanTheManIO, December 09, 2005, 03:39:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

OIDanTheManIO

Where is the title on the frontpage of TP declared?  The title being <title></title>.  I can't seem to find it anywhere.

gerrymo

Its in index.template.php

OIDanTheManIO

Quote from: gerrymo on December 09, 2005, 03:40:33 PM
Its in index.template.php

No sir, I meant for the TP FRONTPAGE.

gerrymo

Sorry. Can you expand on this? I dont see what title you mean.

IchBin

#4
I'm no expert, but I do believe it is from the index.template.php
But the actual title is called from the $context['page_title']. I think that means depending on which template file is being called in the index.template (boardindex, or messageindex etc.) the page title is different.
I've been meaning to ask Bloc if he would explain a little bit how this works:
global $context, $settings, $options, $txt;  Where are these globals located. :)

--edit after a bit of searching I found the page title being set in the TPortal.php file in the Sources directory at this line:
        // Set the page title.
        $context['page_title'] = $context['forum_name'];

bloc

Quite right. :)


The globals..? They are from any file that have been loaded at that time. So if you load in Load.php(which always is executed) it sets up $settings. But to use that, you need to make it avaiable via the "global" call, so that YOUR function can access it too. ( I think php just copy over the variable to each function and updates back and forth, but not sure) Therefore its effecient to just load in the ones you will need.

Missing globals will many times explain why something just don't work..even if all seems perfectly fine. ;)

OIDanTheManIO

Quote from: IchBinâââ,¬Å¾Ã,¢ on December 09, 2005, 03:58:33 PM
I'm no expert, but I do believe it is from the index.template.php
But the actual title is called from the $context['page_title']. I think that means depending on which template file is being called in the index.template (boardindex, or messageindex etc.) the page title is different.
I've been meaning to ask Bloc if he would explain a little bit how this works:
global $context, $settings, $options, $txt;  Where are these globals located. :)

--edit after a bit of searching I found the page title being set in the TPortal.php file in the Sources directory at this line:
        // Set the page title.
        $context['page_title'] = $context['forum_name'];


I already knew that.  What I need to know is in what file is $context['page_title'] called?

bloc

index.template is the one actually setting the title tag - which use the data in the $context variable. And each Source file sets that variable according to what it does.

OIDanTheManIO

Quote from: Bloc on December 10, 2005, 08:23:01 PM
index.template is the one actually setting the title tag - which use the data in the $context variable. And each Source file sets that variable according to what it does.

Thanks, I found what I needed.

jazz

I wish it was described what the solution was.  On the front page of TinyPortal, the page title is just "Home".  How do I change that to the site name?

This website is proudly hosted on Crocweb Cloud Website Hosting.