Ask Your Question
0

How to reference a new template file defined in a custom skin?

asked 2012-07-04 17:02:39 -0500

theactiveactor gravatar image theactiveactor
147 7 2 6

I created a new skin called myskin and set ASKBOT_EXTRA_SKINS_DIR accordingly. Overwriting default templates seems to work.

I want to create a custom home page, with a template called "home.html", located in this new skin, which inherits from "one_column_body.html" (defined in common).

However, in my custom app (installed along with askbot), when I tried to invoke render_to_response() on "home.html", I get this error: "TemplateDoesNotExist at /"

delete close flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-07-04 17:09:05 -0500

Evgeny gravatar image Evgeny flag of Chile
11044 50 84 182
http://askbot.org/

That's because creating a template does not automatically create an url or the function that would respond to the url.

If your page is static you could change configuration for url / in the askbot/urls.py and create a simple view that renders your template and returns a response with the rendered contents.

link publish delete flag offensive edit

Comments

I did that already, you misunderstood my question. Let me rephrase it this way- calling render_to_response() from a view fails to find template files that are located in a custom skin.

theactiveactor ( 2012-07-07 15:15:29 -0500 )edit

render_to_response won't pick up a template for the skin, right now askbot uses it's own render_into_skin, but this is fixable - we will make use of the standard template loading API. We will also simplify the way templates are organized in the skin. I think we will also leave just default theme in askbot - to simplify the directory structure as much as possible.

Evgeny ( 2012-07-07 15:23:28 -0500 )edit

That is fine, thank you for clarifying. render_into_skin() looks like it's sufficient for my needs.

theactiveactor ( 2012-07-07 23:12:07 -0500 )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

subscribe to rss feed

Stats

Asked: 2012-07-04 17:02:39 -0500

Seen: 42 times

Last updated: Jul 04 '12