Auto-Insert On New FAQs

All about webserver configurations, PHP and databases.

Moderator: Thorsten

Post Reply
Grunt
Posts: 38
Joined: Fri May 27, 2022 2:29 pm

Auto-Insert On New FAQs

Post by Grunt »

Is it possible to have information automatically inserted on new FAQs? For example, I click on 'Add New FAQ' and then in the answer box, the below is automatically inserted into the 'Your Answer' box.

Code: Select all

Symptom

Problem

Solution

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

Re: Auto-Insert On New FAQs

Post by Thorsten »

Hi,

you can use the TinyMCE Template Plugin for that: https://www.tiny.cloud/docs/plugins/ope ... /template/

It's enabled by default in phpMyFAQ.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Grunt
Posts: 38
Joined: Fri May 27, 2022 2:29 pm

Re: Auto-Insert On New FAQs

Post by Grunt »

I don't see anything in the documentation on how to do anything with that. Do I implement a template in javascript like the example you linked? Where would I put that file?
Thorsten
Posts: 15561
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Auto-Insert On New FAQs

Post by Thorsten »

Hi,

I'll check this.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15561
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Auto-Insert On New FAQs

Post by Thorsten »

Hi,

here's the fix for this: https://github.com/thorsten/phpMyFAQ/co ... b597b1231a

Will be released with 3.1.8 soon!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Grunt
Posts: 38
Joined: Fri May 27, 2022 2:29 pm

Re: Auto-Insert On New FAQs

Post by Grunt »

Fantastic, thanks.
Grunt
Posts: 38
Joined: Fri May 27, 2022 2:29 pm

Re: Auto-Insert On New FAQs

Post by Grunt »

Question, if I am using URL to point to a file, what's the source path that it starts looking at?
Grunt
Posts: 38
Joined: Fri May 27, 2022 2:29 pm

Re: Auto-Insert On New FAQs

Post by Grunt »

Also, I replaced my footer.php with the latest version that implements the changes you've made and I can see my custom template in Add New FAQ on the administration side (YAY!). However, if I am in the non-admin section of phpMyFAQ and click on Add New FAQ>Insert>Template, it tells me "No templates defined".
Thorsten
Posts: 15561
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Auto-Insert On New FAQs

Post by Thorsten »

Hi,

I didn't added that possibility to the frontend, as this should be reduced.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Grunt
Posts: 38
Joined: Fri May 27, 2022 2:29 pm

Re: Auto-Insert On New FAQs

Post by Grunt »

I'd like to request that as a feature. I could see where non-admin users would find certain templates useful. Personally, I like entering new FAQs from the front end page just because it's quicker/easier to get to.
Thorsten
Posts: 15561
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Auto-Insert On New FAQs

Post by Thorsten »

Hi,

I think it needs to be thought bigger as you need to add own templates easily as well. What do you think?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Grunt
Posts: 38
Joined: Fri May 27, 2022 2:29 pm

Re: Auto-Insert On New FAQs

Post by Grunt »

I could see value in being able to have "personal" templates, but I imagine that requires a much larger effort for implementation. I think templates could be fleshed out to:

Universal: Available to all, including guest
Corporate: Available to authenticated users
Group: Available to users in a group
Personal: Available only to the authenticated user that created it

I'm not a developer myself, but I imagine some of these scenarios would require significantly more work to implement than others. In addition, a GUI method of saving something as a template would be required, I think this would be fantastic to have in itself.
Post Reply