implementing a page inside myfaq?

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
tomperys
Posts: 67
Joined: Tue May 14, 2013 10:17 am

implementing a page inside myfaq?

Post by tomperys » Tue Feb 12, 2019 8:30 pm

Hi
we want to implement our own page (php code) either inside the post or just make some one page with same design and put a links somewhere (for example like sitemap page, which is linked from footer and ist one page inside the template). Its somehow possible?

Thorsten
Posts: 14730
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: implementing a page inside myfaq?

Post by Thorsten » Wed Feb 13, 2019 4:37 pm

Hi,

it's documented here: https://faq.phpmyfaq.de/content/23/9/en ... ework.html

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

tomperys
Posts: 67
Joined: Tue May 14, 2013 10:17 am

Re: implementing a page inside myfaq?

Post by tomperys » Wed Feb 13, 2019 5:53 pm

Hi

thanks, but tshis explain only how to make template file and one php file wchich only writes content as text in one variable. What we need is take a whole PHP code and make it available on some page

Thorsten
Posts: 14730
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: implementing a page inside myfaq?

Post by Thorsten » Wed Feb 13, 2019 6:03 pm

Hi,

you can write whatever code you want into the PHP file.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

tomperys
Posts: 67
Joined: Tue May 14, 2013 10:17 am

Re: implementing a page inside myfaq?

Post by tomperys » Wed Feb 13, 2019 6:48 pm

Hi

then maybe I dodnt understand how it should work becuase in TPL file there is {testContent} which should print whats in PHP file as 'testContent' => $testContent (in that $tpl->processTemplate...). If I fjust put anything I want in my PHP file, like ordinary:
<?php
echo "test";
?>

then it doesnt work at all - if I use index.php?action=test Iam getting ERR_CONTENT_DECODING_FAILED

Thorsten
Posts: 14730
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: implementing a page inside myfaq?

Post by Thorsten » Thu Feb 14, 2019 8:27 am

Hi,

yes, it doesn't work as you output a string before the gzipping starts. Enable the debug mode in inc/Bootstrap.php and it should work.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

tomperys
Posts: 67
Joined: Tue May 14, 2013 10:17 am

Re: implementing a page inside myfaq?

Post by tomperys » Thu Feb 14, 2019 9:11 pm

Ok thanks it seems to worked somehow (even if the result of the PHP file was printed above the menu and content of the page....). But after updating from 2.9.11 to 2.9.12 and from that to 2.9.13 it doest work at all, the page with index.php?action=... shows the homepage without the PHP file result (and even when the debug is false).

Thorsten
Posts: 14730
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: implementing a page inside myfaq?

Post by Thorsten » Thu Feb 14, 2019 9:45 pm

Hi,

did you overwrite your changed constants.php file with the update?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

tomperys
Posts: 67
Joined: Tue May 14, 2013 10:17 am

Re: implementing a page inside myfaq?

Post by tomperys » Thu Feb 14, 2019 11:06 pm

oh ok, forget that, bow I added the name to constatns but
  • when I try the example from https://faq.phpmyfaq.de/content/10/9/en ... ework.html it "works" also only with debug=true, but work is a strong word, there is just the page with menu and everything but without the content and with errors "Undefined index: writeContent in ..../www/inc/PMF/Template.php on line 107" and it also just print all the code from PHP as text (that one taht on your mention page stars with: '; } $tpl->processTemplat....)
  • If I use some regular PHP file with empty tpl file, I get the printed result but also (because of the dfebug mode) error notice, again the one "phpMyFAQ notice [8]: Undefined index: writeContent in ..../www/inc/PMF/Template.php on line 107" and the conted is sadly printed not in content area but between the header with logo and the menu and content....

Thorsten
Posts: 14730
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: implementing a page inside myfaq?

Post by Thorsten » Sat Feb 16, 2019 11:45 am

Hi,

I'll re-check this issue.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

Post Reply