Customizing FAQ / Guidelines Pages

i didn’t find it documented in detail anywhere, so i thought i’d make some notes about what i found so far and ask some questions. :slight_smile:

Guidelines and FAQ are two separate entities that are combined in the default config.

SiteSetting.faq_url = '' (default):

FAQ:

  • routes: /faq, /guidelines, /rules, /conduct → a template (or something) populated with content from SiteSetting.guidelines_topic_id (FAQ/Guidelines topic in the Staff category)
  • relevant localizations (Admin > Customize > Text): I18n.t('js.faq'), I18n.t('js.sidebar.sections.community.links.faq.content'), etc
  • shows up in the sidebar

SiteSetting.faq_url = 'foo':

even though it says full url, it seems like it can be a relative url like /t/25, which is useful.

Guidelines:

  • routes: /guidelines, /rules, /conduct → template using content from SiteSetting.guidelines_topic_id
  • localizations: I18n.t('js.guidelines'), etc

FAQ:

  • routes: /faqSiteSetting.faq_url
    • for better or worse, this is a direct link to that URL. it doesn’t pull the content and put it into a template like Guidelines does. it’s intended to give you the option of linking to an external resource.
  • localizations: I18n.t('js.faq'), I18n.t('js.sidebar.sections.community.links.faq.content'), etc
  • shows up in the sidebar

Questions

i am opting for a separate FAQ, and i am linking it to a FAQ topic.

  1. i can’t figure out how to set the topic title to simply FAQ – not Faq or similar. i tried SiteSetting.title_prettify and SiteSetting.min_topic_title_length. the closest i can get is Faq (and it is stored in the db like that). i tried directly editing the db like SQL: update topics set title = 'FAQ' where id=25;, but that’s a bad idea, and it didn’t even work anyways. the updated value shows up in the topic edit dialog, but idk how to force a refresh. rebuild HTML didn’t work. i guess i need to do this in rails, but idk how.
    • here’s how (please tell me if this is wrong):
Topic.find(25).update(title: 'FAQ')
  1. what is the most elegant way to get Guidelines into the Community section of the sidebar for all users? can i somehow use the new custom sidebar thing?

  2. what’s I18n.t('guidelines_topic.title')? is that merely used during initial topic creation when you start fresh?

thanks

5 Likes

There is a documentation for frequently asked questions in:

2 Likes