In this board you can talk about general questions about phpMyFAQ
Moderator: Thorsten
ueland
Posts: 4 Joined: Wed May 07, 2003 4:22 pm
Post
by ueland » Wed May 07, 2003 4:23 pm
Hello
how can i get php includes to work in the templates files, the server is set up to parse php code i html files so that is not a problem, but it is not working.
Thorsten
Posts: 15725 Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:
Post
by Thorsten » Wed May 07, 2003 4:50 pm
Hi,
just put an variable in the template file, e.g. something like that
Then edit the file index.php and put this new variable in the array:
Code: Select all
$tpl->processTemplate ("index", array(
"writeTitle" => $title,
"metaDescription" => $metaDescription,
"metaKeywords" => $metaKeywords,
"metaPublisher" => $metaPublisher,
....
"myPHPinclude" => include("yourpage.php"),
.....
bye
Thorsten
ueland
Posts: 4 Joined: Wed May 07, 2003 4:22 pm
Post
by ueland » Wed May 07, 2003 5:01 pm
i also added a include command in index.php in top and bottom of the files to get includet a file in the top and bottom before i read that.
Thorsten
Posts: 15725 Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:
Post
by Thorsten » Wed May 07, 2003 5:02 pm
Hi,
this works, too.
bye
Thorsten
ueland
Posts: 4 Joined: Wed May 07, 2003 4:22 pm
Post
by ueland » Wed May 07, 2003 5:09 pm
hmm..now all includes gets paresed first :s before the rest of the page
http://www.programmer.no/faq/index.php
"toppinclude" => @include "$DOCUMENT_ROOT/themes/2003/topp.php",
"menyh1" => include ("../themes/2003/meny_h1.php"),
"menyh2" => include ("../themes/2003/meny_h2.php"),
Thorsten
Posts: 15725 Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:
Post
by Thorsten » Wed May 07, 2003 10:38 pm
Hi,
I will test this!
bye
Thorsten
ueland
Posts: 4 Joined: Wed May 07, 2003 4:22 pm
Post
by ueland » Thu May 08, 2003 12:15 pm
Think that it got something to do with the feature of PHP, maybe you shold for the next release make php include possible in the template files and "skip" them in the index.php files.
Pädu
Post
by Pädu » Wed May 21, 2003 7:03 pm
When I replace the include by a {phpmyinclude} and try to replace them as you recommended it, the included file appears on top of the page and not at the former {phpmyinclude} ;-(
http://www.studisurf.ch/services/phpmyfaq/index_kk.php
What could be wrong? Thx for support!