Re: using forloop variable to get the provide special tags for the 4th element.

2008-09-23 Thread sotirac

Hi Steve, the cycle tag fixed the issue.
Thanks.

On Sep 15, 1:00 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> Lee Hinde wrote:
>
> > On Sun, Sep 14, 2008 at 10:00 PM, sotirac <[EMAIL PROTECTED]
> > > wrote:
>
> >     In the django template where I am using a for loop, I have to use a
> >     special tag (div class="yui-u first" instead of div class="yui") for
> >     every forth item.  Im trying to create a table with three columns.  I
> >     can access the first loop but how do I do it for every third.
> >     --
> >     
> >     {% extends "base.html" %}
>
> >     {% block content %}
> >            {% for website in websites %}
> >            {% if forloop.first %}
> >            
> >            {% else %}
> >            
> >            {% endif %}
> [...]
> > Check the template tags. I think divisibleby might work for you.
>
> An easy way to implement this feature is the "cycle" tag.
>
> >            {% if forloop.first %}
> >            
> >            {% else %}
> >            
> >            {% endif %}
>
> would then become
>
> 
>
> However I'm not really able to understand the rest of your logic enough
> to determine how the remainder of the code would change, because I'm not
> sure I understand it well enough.
>
> regards
>  Steve
> --
> Steve Holden        +1 571 484 6266   +1 800 494 3119
> Holden Web LLC              http://www.holdenweb.com/
--~--~-~--~~~---~--~~
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 email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using forloop variable to get the provide special tags for the 4th element.

2008-09-15 Thread Steve Holden

Lee Hinde wrote:
> 
> 
> On Sun, Sep 14, 2008 at 10:00 PM, sotirac <[EMAIL PROTECTED]
> > wrote:
> 
> 
> In the django template where I am using a for loop, I have to use a
> special tag (div class="yui-u first" instead of div class="yui") for
> every forth item.  Im trying to create a table with three columns.  I
> can access the first loop but how do I do it for every third.
> --
> 
> {% extends "base.html" %}
> 
> {% block content %}
>{% for website in websites %}
>{% if forloop.first %}
>
>{% else %}
>
>{% endif %}
[...]
> Check the template tags. I think divisibleby might work for you.
> 
An easy way to implement this feature is the "cycle" tag.

>{% if forloop.first %}
>
>{% else %}
>
>{% endif %}

would then become



However I'm not really able to understand the rest of your logic enough
to determine how the remainder of the code would change, because I'm not
sure I understand it well enough.

regards
 Steve
-- 
Steve Holden+1 571 484 6266   +1 800 494 3119
Holden Web LLC  http://www.holdenweb.com/


--~--~-~--~~~---~--~~
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 email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using forloop variable to get the provide special tags for the 4th element.

2008-09-15 Thread sotirac

Thank you.  I'll test this out.  I also found the "cycle" tag which
looks very promising.

On Sep 15, 1:05 am, "Lee Hinde" <[EMAIL PROTECTED]> wrote:
> On Sun, Sep 14, 2008 at 10:00 PM, sotirac <[EMAIL PROTECTED]> wrote:
>
> > In the django template where I am using a for loop, I have to use a
> > special tag (div class="yui-u first" instead of div class="yui") for
> > every forth item.  Im trying to create a table with three columns.  I
> > can access the first loop but how do I do it for every third.
> > --
> > 
> > {% extends "base.html" %}
>
> > {% block content %}
> >        {% for website in websites %}
> >        {% if forloop.first %}
> >        
> >        {% else %}
> >        
> >        {% endif %}
> >                {{ website.title
> > }} > h1>
> >    {% for entry in website.entries_one_to_ten %}
> >                        
> >                                   > href="{{entry.url}}">{{ entry.title }}
> >                        
> >                {% endfor %}
> >                {% if website.entries_eleven_to_twenty %}
> >    
> >                  
> >                    {% for entry in website.entries_eleven_to_twenty %}
> >                                        
> >                                                   > href="{{entry.url}}">{{ entry.title }}
> >                                        
> >                                {% endfor %}
> >                  
> >                
> >                More/Less
> >                {% endif %}
> >        
> >        {% endfor %}
> > {% endblock %}
> > 
>
> Check the template tags. I think divisibleby might work for you.
>
>
>
> >http://docs.djangoproject.com/en/dev/ref/templates/builtins/#divisibleby
--~--~-~--~~~---~--~~
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 email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: using forloop variable to get the provide special tags for the 4th element.

2008-09-14 Thread Lee Hinde
On Sun, Sep 14, 2008 at 10:00 PM, sotirac <[EMAIL PROTECTED]> wrote:

>
> In the django template where I am using a for loop, I have to use a
> special tag (div class="yui-u first" instead of div class="yui") for
> every forth item.  Im trying to create a table with three columns.  I
> can access the first loop but how do I do it for every third.
> --
> 
> {% extends "base.html" %}
>
> {% block content %}
>{% for website in websites %}
>{% if forloop.first %}
>
>{% else %}
>
>{% endif %}
>{{ website.title
> }} h1>
>{% for entry in website.entries_one_to_ten %}
>
>   href="{{entry.url}}">{{ entry.title }}
>
>{% endfor %}
>{% if website.entries_eleven_to_twenty %}
>
>  
>{% for entry in website.entries_eleven_to_twenty %}
>
>   href="{{entry.url}}">{{ entry.title }}
>
>{% endfor %}
>  
>
>More/Less
>{% endif %}
>
>{% endfor %}
> {% endblock %}
> 


Check the template tags. I think divisibleby might work for you.

>
> http://docs.djangoproject.com/en/dev/ref/templates/builtins/#divisibleby
>

--~--~-~--~~~---~--~~
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 email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



using forloop variable to get the provide special tags for the 4th element.

2008-09-14 Thread sotirac

In the django template where I am using a for loop, I have to use a
special tag (div class="yui-u first" instead of div class="yui") for
every forth item.  Im trying to create a table with three columns.  I
can access the first loop but how do I do it for every third.
--

{% extends "base.html" %}

{% block content %}
{% for website in websites %}
{% if forloop.first %}

{% else %}

{% endif %}
{{ website.title }}
{% for entry in website.entries_one_to_ten %}

  {{ entry.title }}

{% endfor %}
{% if website.entries_eleven_to_twenty %}

  
{% for entry in website.entries_eleven_to_twenty %}

  {{ entry.title }}

{% endfor %}
  

More/Less
{% endif %}

{% endfor %}
{% endblock %}

--~--~-~--~~~---~--~~
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 email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---