Changing FAQ text

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
MarkDHamill
Registered User
Posts: 4362
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Changing FAQ text

Post by MarkDHamill »

I'd like an extension to change some of phpBB's FAQ text by pulling the text from the extension's language file and replacing the default language strings selectively.

It's not clear to me what the best way to do this is. In /phpbb/help/manager.php I see this event: core.help_manager_add_question_after. It uses the function add_question() but it's only called from the function add_block().

Without knowing the help block too, how would phpBB know which block should be used? But even if I tie into the core.help_manager_add_question_after event, wouldn't add a nearly duplicate question rather than replace it?

I would like to selectively replace some of these language strings. Seems there must be a better way to do this.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
KaileyT
Community Team Member
Community Team Member
Posts: 2933
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Truscott
Contact:

Re: Changing FAQ text

Post by KaileyT »

Haven't looked at the FAQ file, but couldn't you make a language file which duplicate the language var name and use placeholders? Obviously, this is just a mock-up.

Code: Select all

'FAQ_TEXT_1'	=> '%1$s',

Code: Select all

$this->template->assign_vars([
	'FAQ_1'	=> $this->language->lang('FAQ_TEXT_1', $row['db_value']),
]);
Not sure if duplicating core language vars is allowed though.
Kailey Truscott - Community Team
User avatar
MarkDHamill
Registered User
Posts: 4362
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Changing FAQ text

Post by MarkDHamill »

I placed it in the language file en/common.php file but it doesn't take. So it needs to be attached somehow. I assumed an applicable event was the way to go.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 4741
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Changing FAQ text

Post by kasimi »

Did you see this extension? viewtopic.php?t=2481781
User avatar
MarkDHamill
Registered User
Posts: 4362
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: Changing FAQ text

Post by MarkDHamill »

Yes, I was considering that and I may go with that solution. I'm trying to consolidate a number of custom changes into one extension for ease of future maintenance. But thanks for reminding me!
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5352
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman
Contact:

Re: Changing FAQ text

Post by MattF »

You may be able to overwrite them with the core.help_manager_add_block_after event
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
Post Reply

Return to “Extension Writers Discussion”