Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5

Gallery responsive
#15

Bonjour,
Voilà... je me suis servi du module Événement pour obtenir ces fameux affichage par carte !
J'ai les cartes réparties comme je le voulais... sauf que mes événements ne se dispatchent pas "par carte" mais "par lignes". Voire ici...
J'ai donc chaque événement répétés autant de fois par ligne.
Bon, évidemment, ça doit me crever les yeux...
J’ai essayé plein de manière toute la matinée mais je sèche !
Voici le code du Sommaire de base :
Code :
[== Indéfini ==]
{* Events summary default template *}
{* Events and details are stored in the $items array *}
{* What can you use in this template? Some examples:
        {$entry->name} : event name
        {$entry->description} : event description
        {$entry->category} : the category object
            {$entry->category->name} : category name
            {$entry->category->description} : category description
        {$entry->start_datetime} : event start datetime (i.e. {$entry->start_datetime|cms_date_format}) - Same with "end_datetime"
        {$entry->capacity} : capacity of the event
        {$entry->fields : an array of extra fields
            If you have an extra field with the alias "place", use :
            {$entry->fields.place->value}

        NOTE : sometimes, the extrafields values are arrays, so use {$entry->fields.place|print_r} to see what is available

        Use {$entry|print_r} to display all the infos available
*}
{if $items|@count}
    {foreach from=$items item=entry}
    
        {* Important, do not remove the line above: *}
        {assign var='overquotanb' value=0}
        
        <h3>{$entry->name}</h3>
        {if isset($entry->category)}
            <p>Catégorie : {$entry->category->name}</p>
        {/if}
        <p>De : {$entry->start_datetime|cms_date_format} à : {$entry->end_datetime|cms_date_format}</p>
        <a href="{$entry->detailurl}">Détails de l'événement</a>

        {if $entry->allow_registration}
            <h5>Réservation</h5>
            <p>Places actuellement réservées : {$entry->nb_regusers} / Capacité : {if $entry->capacity > 0}{$entry->capacity} / Places restantes: {math equation="x - y" x=$entry->capacity y=$entry->nb_regusers} {else}Unlimited{/if}</p>

            {if isset($entry->registration_url)}
                <p><a href="{$entry->registration_url}">Register</a></p>
            {/if}

            {EventsManager action='register' event_id=$entry->id inline=1 allow_notconnected=1}
        {/if}

        {*if !empty($entry->description)}
            <h4>Description</h4>
            <p>{$entry->description}</p>
        {/if*}

        {* Extra fields *}
        {if isset($entry->fields)}
            {foreach from=$entry->fields item='oneval' key='key'}
                <h4>{$oneval->name}</h4>
                <div>
                    {if $oneval->type eq 'image' and $oneval->value neq ''}
                        <img src="{$oneval->file_url}" style="max-width: 200px" />
                    {elseif $oneval->type eq 'checkboxes' and !empty($oneval->value)}
                        <ul>
                            {foreach from=$oneval->value item='onecheckbox'}
                                <li>{$onecheckbox}</li>
                            {/foreach}
                        </ul>
                    {elseif $oneval->value neq ''}
                        {$oneval->value}
                    {else}
                        <p>No value for {$oneval->name}</p>
                    {/if}
                </div>
                <br /><br />

                {* Uncomment to display all the info for the current field : *}
                {*
                    {$key} : {$oneval|print_r}<br /><br />
                *}
            {/foreach}
        {/if}

        {* <a href="{$entry->detailurl}">Détails sur cet événement...</a> *}
<hr>        
    {/foreach}
{else}
    <p>
Aucun évènement</p>
{/if}

Et voici le mien que j'ai aménagé... :
Code :
[== Indéfini ==]
{* Events summary default template *}
{* Events and details are stored in the $items array *}
{* What can you use in this template? Some examples:
        {$entry->name} : event name
        {$entry->description} : event description
        {$entry->category} : the category object
            {$entry->category->name} : category name
            {$entry->category->description} : category description
        {$entry->start_datetime} : event start datetime (i.e. {$entry->start_datetime|cms_date_format}) - Same with "end_datetime"
        {$entry->capacity} : capacity of the event
        {$entry->fields : an array of extra fields
            If you have an extra field with the alias "place", use :
            {$entry->fields.place->value}

        NOTE : sometimes, the extrafields values are arrays, so use {$entry->fields.place|print_r} to see what is available

        Use {$entry|print_r} to display all the infos available
*}
{if $items|@count}
    {foreach from=$items item=entry}
    {* Important, do not remove the line above: *}
        {assign var='overquotanb' value=0}
            {* début de la card-product *}
        {* colonne 1 *}
    <div class="large-4 columns small-6">
      <div class="item-wrapper">
        <div class="img-wrapper">
        <a class="button expand add-to-cart" href="{$entry->detailurl}">Voir le détail</a>
        <a href="{$entry->detailurl}"><img src="http://i.imgur.com/Mcw06Yt.png"alt="" /></a>
        </div>
        <h5>{$entry->name}</h5>
        {if isset($entry->category)}
            <p>{$entry->category->name}</p>
        {/if}
        <p>Du : {$entry->start_datetime|cms_date_format} au : {$entry->end_datetime|cms_date_format}</p>
        {* <a href="{$entry->detailurl}">Détails de l'événement</a>
        {if $entry->allow_registration}
            <h5>Réservation</h5>
            <p>Places actuellement réservées : {$entry->nb_regusers} / Capacité : {if $entry->capacity > 0}{$entry->capacity} / Places restantes: {math equation="x - y" x=$entry->capacity y=$entry->nb_regusers} {else}Unlimited{/if}</p>
            {if isset($entry->registration_url)}
                <p><a href="{$entry->registration_url}">Register</a></p>
            {/if}
            {EventsManager action='register' event_id=$entry->id inline=1 allow_notconnected=1}
        {/if}
        
        {* Extra fields *}
        {if isset($entry->fields)}
            {foreach from=$entry->fields item='oneval' key='key'}
                <h6>{$oneval->name}</h6>
                <div>
                    {if $oneval->type eq 'image' and $oneval->value neq ''}
                        <img src="{$oneval->file_url}" style="max-width: 200px" />
                    {elseif $oneval->type eq 'checkboxes' and !empty($oneval->value)}
                        <ul>
                            {foreach from=$oneval->value item='onecheckbox'}
                                <li>{$onecheckbox}</li>
                            {/foreach}
                        </ul>
                    {elseif $oneval->value neq ''}
                        {$oneval->value}
                    {else}
                        <p>No value for {$oneval->name}</p>
                    {/if}
                </div>
            {/foreach}*}
        {/if}         
        </div>  
    </div>
    {* colonne 2 *}
    <div class="large-4 columns small-6">
      <div class="item-wrapper">
        <div class="img-wrapper">
        <a class="button expand add-to-cart" href="{$entry->detailurl}">Voir le détail</a>
        <a href="{$entry->detailurl}"><img src="http://i.imgur.com/Mcw06Yt.png"alt="" /></a>
        </div>
        <h5>{$entry->name}</h5>
        {if isset($entry->category)}
            <p>{$entry->category->name}</p>
        {/if}
        <p>De : {$entry->start_datetime|cms_date_format} à : {$entry->end_datetime|cms_date_format}</p>
        {* <a href="{$entry->detailurl}">Détails de l'événement</a>

        {if $entry->allow_registration}
            <h5>Réservation</h5>
            <p>Places actuellement réservées : {$entry->nb_regusers} / Capacité : {if $entry->capacity > 0}{$entry->capacity} / Places restantes: {math equation="x - y" x=$entry->capacity y=$entry->nb_regusers} {else}Unlimited{/if}</p>

            {if isset($entry->registration_url)}
                <p><a href="{$entry->registration_url}">Register</a></p>
            {/if}

            {EventsManager action='register' event_id=$entry->id inline=1 allow_notconnected=1}
        {/if}

        {*if !empty($entry->description)}
            <h4>Description</h4>
            <p>{$entry->description}</p>
        {/if*}

        {* Extra fields *}
        {if isset($entry->fields)}
            {foreach from=$entry->fields item='oneval' key='key'}
                <h4>{$oneval->name}</h4>
                <div>
                    {if $oneval->type eq 'image' and $oneval->value neq ''}
                        <img src="{$oneval->file_url}" style="max-width: 200px" />
                    {elseif $oneval->type eq 'checkboxes' and !empty($oneval->value)}
                        <ul>
                            {foreach from=$oneval->value item='onecheckbox'}
                                <li>{$onecheckbox}</li>
                            {/foreach}
                        </ul>
                    {elseif $oneval->value neq ''}
                        {$oneval->value}
                    {else}
                        <p>No value for {$oneval->name}</p>
                    {/if}
                </div>
                <br /><br />  *}

                {* Uncomment to display all the info for the current field : *}
                
            {/foreach}
        {/if}

        
        </div>  
    
    </div>
    {* colonne 3 *}
    <div class="large-4 columns small-6">
      <div class="item-wrapper">
        <div class="img-wrapper">
        <a class="button expand add-to-cart" href="{$entry->detailurl}">Voir le détail</a>
        <a href="{$entry->detailurl}"><img src="http://i.imgur.com/Mcw06Yt.png"alt="" /></a>
        </div>
        <h5>{$entry->name}</h5>
        {if isset($entry->category)}
            <p>{$entry->category->name}</p>
        {/if}
        <p>De : {$entry->start_datetime|cms_date_format} à : {$entry->end_datetime|cms_date_format}</p>
        {* <a href="{$entry->detailurl}">Détails de l'événement</a>

        {if $entry->allow_registration}
            <h5>Réservation</h5>
            <p>Places actuellement réservées : {$entry->nb_regusers} / Capacité : {if $entry->capacity > 0}{$entry->capacity} / Places restantes: {math equation="x - y" x=$entry->capacity y=$entry->nb_regusers} {else}Unlimited{/if}</p>

            {if isset($entry->registration_url)}
                <p><a href="{$entry->registration_url}">Register</a></p>
            {/if}
            {EventsManager action='register' event_id=$entry->id inline=1 allow_notconnected=1}
        {/if}
        {* Extra fields *}
        {if isset($entry->fields)}
            {foreach from=$entry->fields item='oneval' key='key'}
                <h4>{$oneval->name}</h4>
                <div>
                    {if $oneval->type eq 'image' and $oneval->value neq ''}
                        <img src="{$oneval->file_url}" style="max-width: 200px" />
                    {elseif $oneval->type eq 'checkboxes' and !empty($oneval->value)}
                        <ul>
                            {foreach from=$oneval->value item='onecheckbox'}
                                <li>{$onecheckbox}</li>
                            {/foreach}
                        </ul>
                    {elseif $oneval->value neq ''}
                        {$oneval->value}
                    {else}
                        <p>No value for {$oneval->name}</p>
                    {/if}
                </div>
                <br /><br />  *}
            {/foreach}
        {/if}
        
        </div>  
    </div>
    {/foreach}
    <hr>
{else}
    <p>
Aucun évènement</p>
{/if}

Qu'est-ce qui cloche, docteur ?

Bon, le look est affreux... mais je m'attaquerai au css plus tard ; quand cela fonctionnera.
Merci

Rolleyes
Répondre


Messages dans ce sujet

Atteindre :


Utilisateur(s) parcourant ce sujet : 2 visiteur(s)