I am currently modifying the default template and I am stuck at the following. I am trying to make the tabBar class to display on every page, changing its title accordingly. The code for that class is:

{% include "question_list/title.html" %}

{{ questions.paginator.sort_tabs }}

So the problem I am experiencing is that the title of the tabBar does not change to the question's title on the question page. Let's say I have a question titled "Template modification". I need the tabBar to change its title to "Template modification". To do that I thought I needed to edit the "question_list/title.html" file. The code there is:

{% if searchtag %}

{% trans "Found by tags" %}

{% else %}

{% if searchtitle %}

{% if settings.USE_SPHINX_SEARCH %}

{% trans "Search results" %}

{% else %}

{% trans "Found by title" %}

{% endif %}

{% else %}

{% if is_unanswered %}

{% trans "Unanswered questions" %}

{% else %}

{% if page_title %}

{% trans page_title %}

{% else %}

{% trans "All Questions" %}

{% endif %}

{% endif %}

{% endif %}

{% endif %}

So I took the following string from question.html:

{{ question.headline }}

and added the following lines in "question_list/title.html":

{% if question.headline %}

                {% trans question.headline %}

        {% else %}

{% trans "All Questions" %}

        {% endif %}

I'm afraid however that the above did not work. The script started outputting errors. I believe that the page_title string should already be doing this for me, however it seems that it cannot generate the title successfully and it always displays "All Questions".

Any ideas will be greatly appreciated.

asked 29 Jul '10, 02:39

Georgi%20Vasilev's gravatar image

Georgi Vasilev
38661414
accept rate: 23%


Never mind, I found a solution :)

Thanks.

link

answered 29 Jul '10, 07:48

Georgi%20Vasilev's gravatar image

Georgi Vasilev
38661414
accept rate: 23%

I'm having the same problem. What did you do to fix it?

thx

link

answered 11 Apr '11, 10:40

dfj01's gravatar image

dfj01
1
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×23
×9

Asked: 29 Jul '10, 02:39

Seen: 588 times

Last updated: 11 Apr '11, 10:40

powered by OSQA