Ask Your Question
3

FAQ to settings

asked 2011-07-21 10:04:26 -0500

DominiCattus gravatar image DominiCattus flag of Russian Federation
107 2 1 8

updated 2011-07-31 13:17:00 -0500

mether gravatar image mether flag of India
1272 27 17 45
http://fedoraproject.org/

Could FAQ be moved to settings?
Sometimes there's need to customize it, some points should be removed, some added. There's possibility to change the source code, but I update the source from git, and would prefer to have it editable in settings.

Another question - how can I add my links to header of template? (Like here: "Home Documentation Contact us"). There's customizable footer in settings, but no header.

delete close flag offensive retag edit

Comments

I'd like both of these... maybe I can find time to hack them both. NoahY ( 2011-07-22 11:00:14 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2011-07-22 11:40:54 -0500

NoahY gravatar image NoahY
313 4 2 14
https://github.com/NoahY/...

Okay, that was easy... not sure if Evgeny will accept the exact solution, but here's what I did for the faq:

  1. moved faq.html to faq_static.html
  2. created new faq.html similar to about.html (i.e. dynamic)
  3. added faq section to settings->flatpages
  4. edit meta.py to check for FORUM_FAQ setting. If doesn't exist, load faq_static, otherwise load FORUM_FAQ content:
if getattr(askbot_settings, 'FORUM_FAQ',''):
    return render_into_skin('faq.html', data, request)
return render_into_skin('faq_static.html', data, request)

next stop, custom header :)

link publish delete flag offensive edit

Comments

the new code is in my github repository. NoahY ( 2011-07-22 11:41:22 -0500 )edit
One caveat is that much of the faq is generated code, which you will lose by editing it this way. maybe we can add a hook to parse code like `{{settings.MIN_REP_TO_VOTE_UP}}`, etc.? NoahY ( 2011-07-22 12:28:55 -0500 )edit
Thanks! I'll try to merge it to my code.. About hooks - it will be nice, but sure is not critical now. ) DominiCattus ( 2011-07-25 03:57:58 -0500 )edit
I've pushed a modification that allows you to include hooks AND translations. See here: http://askbot.org/en/question/520/how-to-perform-template-on-askbot-setting for the discussion, or just merge from my repo. You can now copy and paste the entire faq_static.html into the settings box and it parses both {{% trans %}} and {{settings}} tags. NoahY ( 2011-07-25 10:44:14 -0500 )edit
Very cool, I will look at this in the afternoon (it is 12am here now), just don't want to switch to something else right now. Thank you! Evgeny ( 2011-07-25 10:50:57 -0500 )edit
1

answered 2011-07-22 12:01:54 -0500

NoahY gravatar image NoahY
313 4 2 14
https://github.com/NoahY/...

And done... I've added a setting to settings->Skin that adds a custom header portion. Note that this doesn't change the header as it is, just adds html at the end. To actually customize the header would be messier, since it depends on various functions, e.g. whether the user is logged in, their karma, etc.

Also pushed to github:

https://github.com/NoahY/askbot-devel

link publish delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow
2 followers

subscribe to rss feed

Stats

Asked: 2011-07-21 10:04:26 -0500

Seen: 88 times

Last updated: Jul 22 '11