It's namely the second I'm worried about. I have an ordered list and I
want the first entry to have a special style, something to the degree
of "new content." I want to target the second one because I want it to
start the "old content" section, with a different style, like a fade on
top, or someth
Well if you want to target every second, tenth etc. element you can use
the cycle tag.
If you want to highlight the tenth entry because it is special, you
should define it as special in your view code.
If you want to highlight arbitrary entries, well, then... I don't know.
Why would you do that
On 11/3/06, RajeshD <[EMAIL PROTECTED]> wrote:
> {% ifequal forloop.counter "1" %}
> -- Insert code here to render the first blog entry ---
> {% else %}
>-- code for the rest of the blog entries ---
> {% endifequal %}
Note that you should never have to do this:
{% ifequal forloop.cou
Rajesh, I added in the counter and it popped out "1" for the first
entry, so I am unsure why your method didn't work.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, sen
Hazaa, that seemed to have done the trick. When I have a second, I'll
try to debug the sucker too, that way we can have some closure on your
method, Rajesh. Thank you both for your help!
--~--~-~--~~~---~--~~
You received this message because you are subscribed t
Just do
{% if forloop.first %}
...
{% else %}
...
{% endif %}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscrib
Hi Andy,
Try printing out the forloop counter inside the loop to help debug
this:
Counter: {{ forloop.counter }}
-Rajesh
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this grou
It doesn't seem to be working, or at least it hasn't yet come out that
way. I made another attempt where I essentially left out the {else} and
nothing at all rendered, so that filter doesn't seem to be catching it.
--~--~-~--~~~---~--~~
You received this message
Andy wrote:
> http://paste.e-scribe.com/2598/
>
> Check it out!
Wouldn't {% ifequal forloop.counter 1 %} ) (without quotes around 1) do
the trick?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" gr
http://paste.e-scribe.com/2598/
Check it out!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group
Could paste your template code here: http://paste.e-scribe.com/ and
paste the URL to the paste bin in a message here?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, sen
PS the site is main.howcurio.us/blog
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send ema
Okay, so I've put in that code and it processes it fine and everything,
however, all the entries are being placed in the else section, the
filter for counter "1" doesn't seem to be grabbing the latest article.
Is there another filter that could maybe grab it?
--~--~-~--~~
On Nov 3, 3:58 pm, "Andy" <[EMAIL PROTECTED]> wrote:
> Do I need to include {% for object in latest %}? Or, does this replace
> it?
You need to include it:
{% for object in latest %}
{% ifequal forloop.counter "1" %}
-- Insert code here to render the first blog entry ---
{% else %}
-- cod
Do I need to include {% for object in latest %}? Or, does this replace
it?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To
> I want to
> style the first post in a completely different manner than the rest. Is
> there a simple way to do this?
Try this inside the for loop in your template:
{% ifequal forloop.counter "1" %}
-- Insert code here to render the first blog entry ---
{% else %}
-- code for the rest of
I have just set up a blog using the helpful tutorial over at
http://fallingbullets.com/blog/2006/aug/06/wordpress-clone-27-seconds...
and now I am looking to do a little customization.
I am completely new to Django and Python, so if this question seems
simple, forgive my niavete. Here is the cod
17 matches
Mail list logo