🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.python
2 messages
2 total messages Started by andrzejtWYTNIJTO Thu, 21 May 2009 20:01
django - aktywna strona (request.path?) z flatpage
#26104
Author: andrzejtWYTNIJTO
Date: Thu, 21 May 2009 20:01
13 lines
1310 bytes
Problem nowy (dla mnie):

mam strone ktora sklada sie z kilku view i kilku flatpages.
Na gorze mam menu - i zaznaczam aktywna zakladke poprzez oznaczenie w tagu html:
... menuitem class={%ifequal current 'xxx'%}active...

current moge sobie przekazac z view, albo przekazac sobie request, itp.

Ale jak to rozwiazac dla flatpages ?


-- 
Wysłano z serwisu OnetNiusy: http://niusy.onet.pl
Re: django - aktywna strona (request.path?) z flatpage
#26105
Author: Bartek Górny
Date: Fri, 22 May 2009 20:54
17 lines
1331 bytes
On Thu, 21 May 2009 22:01:49 +0200, andrzejtWYTNIJTO wrote:

> Problem nowy (dla mnie):
> 
> mam strone ktora sklada sie z kilku view i kilku flatpages. Na gorze mam
> menu - i zaznaczam aktywna zakladke poprzez oznaczenie w tagu html: ...
> menuitem class={%ifequal current 'xxx'%}active...
> 
> current moge sobie przekazac z view, albo przekazac sobie request, itp.
> 
> Ale jak to rozwiazac dla flatpages ?

Tak na szybko, to bym użył request context processora, i w szablonie dla 
flatpage zrobił
{% ifequal request.path flatpage url %}

Bartek
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads