Creating a template FAQ

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
adanob
Posts: 4
Joined: Wed Oct 26, 2016 4:12 pm

Creating a template FAQ

Post by adanob »

I am trying to create a new FAQ page that is already formatted for users. Is this possible? So far I have targeted the index.php with these lines of code:

Code: Select all

if ($faqConfig->get('main.enableRewriteRules')) {
    $tplNavigation = array(
        'msgSearch' => '<a href="'.$faqSystem->getSystemUri($faqConfig).'search.html">'.$PMF_LANG['msgAdvancedSearch'].'</a>',
 [color=#FF0000]       'msgAddContent' => '<a href="'.$faqSystem->getSystemUri($faqConfig).'addcontent.html">'.$PMF_LANG['msgAddContent'].'</a>',[/color]
		'msgAddFormContent' => '<a href="'.$faqSystem->getSystemUri($faqConfig).'addformcontent.html">'.$PMF_LANG['msgAddFormContent'].'</a>',
->>>>

Code: Select all

} else {
    $tplNavigation = array(
        'msgSearch' => '<a href="index.php?'.$sids.'action=search">'.$PMF_LANG['msgAdvancedSearch'].'</a>',
        'msgAddContent' => '<a href="index.php?'.$sids.'action=add&cat='.$cat.'">'.$PMF_LANG['msgAddContent'].'</a>',
		[color=#FF0000]'msgAddFormContent' => '<a href="index.php?'.$sids.'action=addform&cat='.$cat.'">'.$PMF_LANG['msgAddFormContent'].'</a>',[/color]
-->>>>

}

Code: Select all

$tplNavigation['faqHome'] = $faqConfig->getDefaultUrl();
$tplNavigation['activeAllCategories'] = ('show' == $action) ? 'active' : '';
$tplNavigation['activeAddContent'] = ('add' == $action) ? 'active' : '';
[color=#FF0000]$tplNavigation['activeAddFormContent'] = ('addform' == $action) ? 'active' : '';[/color]
So far what I am getting when I click my navigation link is a duplicate of the Add New Faq page. Any suggestions?
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Creating a template FAQ

Post by Thorsten »

Hi,

you have to whielist the action here: https://github.com/thorsten/phpMyFAQ/bl ... s.php#L187

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
adanob
Posts: 4
Joined: Wed Oct 26, 2016 4:12 pm

Re: Creating a template FAQ

Post by adanob »

Thank you very much. Do I have to edit any additional pages for this to work?
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Creating a template FAQ

Post by Thorsten »

Hi,

nope, should work then.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
adanob
Posts: 4
Joined: Wed Oct 26, 2016 4:12 pm

Re: Creating a template FAQ

Post by adanob »

I am getting an HTTP ERROR 500 (server error).
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Creating a template FAQ

Post by Thorsten »

Hi,

looks like you're having a PHP error in the code, please check the webserver error log

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
adanob
Posts: 4
Joined: Wed Oct 26, 2016 4:12 pm

Re: Creating a template FAQ

Post by adanob »

Hi,

Thank you very much for your assistance. I was not able to get this to work correctly. I discovered that in the admin panel there is a button to copy the Faq. This may be a better way to replicate/standardize a Faq.
Post Reply