For the next step I want to make some changes to the structure of the the pMF pages to overcome some of the issues listed earlier. But at this stage I want to do it in a way that will be universal across any webtrees theme, so involving layout only, not styles. That means a single “webtrees” theme for pMF will work on any webtrees site. This solution will still leave some issues I want to fix, but takes a lot less effort to create and maintain.
- First we need to create a new theme in pMF. That is a simple matter of copying the existing “default” theme and renaming it. The standard theme is /faq/assets/template/default. Copy that whole folder, and call it /faq/assets/template/webtrees.
- Login to the administration pages of pMF. You will find an option under Configuration – Main configuration for “Template set to be used”. Change this to “webtrees” and save.
(Note: This option does not appear until there is more than one template available.)
- To change the overall layout of pMF requires replacing the file index.tpl in your newly created webtrees template. Download the file index.zip from the attachments list at the end of this post, and use the file it contains to replace the one copied from the default template.
You will now have a tidier looking FAQ page within your webtrees framework, similar to this:
One last change before this part is completed. By removing the header from pMF we have also removed the link to pMF’s administration pages. Replace it by adding a second menu item in the webtrees simpl_menu2 settings. Name it something like “FAQ admin“, give it a link of faq/admin, and set its access level to “show to managers”. This will give only you, as admin (unless you have other managers on your site), access to the pMF administration. It will open in a new window, outside of webtrees, which avoids any iframe complications, and will require you to login using the admin credentials you used when setting up pMF.
That completes the second level of a solution for embedding phpMyFAQ in webtrees. The final part will tackle modifying the pMF style sheets to make pMF look and feel more like a native component of webtrees.