PDA

View Full Version : Dynamic Page Title


kavakava
11-30-2005, 11:08 PM
Hi,

I have managed to integrate the directory into my website by including index.php into an existing php document.

However, by doing that, I have lost the dynamic generation of page titles for the directory; if I use

<title>{$smarty.const.DIRECTORY_TITLE}{$smarty.capture.ti tle|strip}</title>

it is not parsed properly; ie, I will see "$smarty.const.DIRECTORY_TITLE}{$smarty.capture.tit le|strip}" instead of the page title.

Any way to fix this?

Thanks!

Ap0s7le
12-01-2005, 04:17 AM
Yes, you can't just include the PHP file, but edit the TPL files to look like your site etc.

If you need this done, feel free to PM me.

-Casey

kavakava
12-01-2005, 11:53 AM
Hi,

Many thanks for your answer.

I have done that, however, my "regular" php page head is parsed before the dynamic part inserted in the body, so my title is static.

Example:

===my 'regular' php document starts here===

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>My Website</title>

<meta name="keywords" content="keywords" />

etc,etc

===inserted index.php starts here===
<?php


require_once 'init.php';
define('DIR_LPP', 20);
$sort_cols = array ( 'P' => 'PAGERANK', 'H' => 'HITS', 'A' => 'TITLE');
$sort_ord = array ( 'P' => 'DESC', 'H' => 'DESC', 'A' => 'ASC');

etc,etc

So, as you can see, if I insert the dynamic title in the head, it is not parsed, as it does not know where to get the function from.

Thanks!

Ap0s7le
12-01-2005, 07:21 PM
Right...

Because you're including PHP, rather than editing your TPL's it seems.

The header info is already being sent, so you're doubling it.

The index.php shouldn't be edited / moved to change the display, only the TPL files.

-Casey