Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Items per line & Breite für parent element

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
Paykoman
Smarty Rookie


Joined: 07 May 2011
Posts: 34

PostPosted: Fri Nov 15, 2013 1:51 pm    Post subject: Items per line & Breite für parent element Reply with quote

Hallo Forum,

ich habe ein Menü gebaut, ansehen könnt ihr euch dies [URL="http://demo.gfw2day.com/d1/"]hier[/URL] damit ihr es nicht suchen müsst öffnet es sich automatisch (auf der linken Seite).

Wenn ihr jetzt auf "Main List 3" geht dann klappt rechts eine kleine Contentbox auf, hier habe ich ein paar Probleme und würde diese gerne mit eurer Hilfe lösen.

Der Container "<ul class="main-itembox-left">" ist der in dem die Items (Blöcke) geladen werden, also der umschließende Container.

1) Ich bekomme es nicht hin das der eben besagter Container die Breite automatisch anpasst, aktuell muss ich immer eine feste Breite oder min-breite angeben.

2) Zu dem würde ich gerne mittels Smarty die Anzahl der Items / line (also wie viele Boxen pro Reihe) festlegen können, da ist die Frage wie man sowas macht habe nichts der gleichen bis her mit Smarty realisiert.

3) Wenn das mit den Items / line funktioniert, kann ich dann mit Smarty irgendwie die Breite des Elternelements damit anpassen?
So das Smarty vor der Ausgabe des elements quasi die anzahl der items zählt diese mit dem zuvorangegebene Breite eines items multipliziert und das als Breite setzten?

Aus einem anderem System kenne ich zb diese Codeschnippsel:
Code:
{assign var='liHeight' value=342}
         {assign var='nbItemsPerLine' value=4}
         {assign var='nbLi' value=$products|@count}
         {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines}
         {math equation="nbLines*liHeight" nbLines=$nbLines|ceil liHeight=$liHeight assign=ulHeight}


Aber ist mir hallt alles noch Fremd wie das da funktioniert, ich hoffe das mir da Jemand etwas helfen kann ist atm echt ein Problem Sad

MFG: Paykoman
Back to top
View user's profile Send private message
Paykoman
Smarty Rookie


Joined: 07 May 2011
Posts: 34

PostPosted: Sun Nov 17, 2013 2:48 pm    Post subject: Reply with quote

Schade das keiner da was sagt =(
Back to top
View user's profile Send private message
Paykoman
Smarty Rookie


Joined: 07 May 2011
Posts: 34

PostPosted: Thu Nov 21, 2013 5:05 pm    Post subject: Reply with quote

Fällt mir nix mehr zu ein Sad

Kennt jemand nen aktiveres Forum mit dem Thema Smarty?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu Nov 21, 2013 10:14 pm    Post subject: Reply with quote

Wenn Deine items z.b. als Array in der Variablen $items steht bekommst die Anzahl so

Code:
{$anzahl = $items|count}


Ist die Breite eines items z.b. 1000 kannst du die gesamt Breite so ausgeben

Code:
{$anzahl * 1000}


Die Beispiele sind für Smarty3
Back to top
View user's profile Send private message
Paykoman
Smarty Rookie


Joined: 07 May 2011
Posts: 34

PostPosted: Fri Nov 22, 2013 8:51 am    Post subject: Reply with quote

Hallo,

dann erst ein mal Danke!
Bis dato war mir ganz entgangen das die auch @count verwenden, werde später mal an der Baustelle weiter arbeiten atm, arbeite ich bei dem Projekt an anderen baustellen die ich erstmal jetzt fertig bekommen möchte.


MFG: Pay
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP