Benutzer-Werkzeuge

Webseiten-Werkzeuge


en:webedition:beginners-guide:listviews

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen gezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
en:webedition:beginners-guide:listviews [2019/02/09 22:26]
Sascha Nemecek
— (aktuell)
Zeile 1: Zeile 1:
-===== Listing Documents (we:​listview) ===== 
  
-The following example displays 10 page-headings,​ teasers and images (if used), ordered by publication date descending. If there are more than 10 results, a link is shown to go to the next 10 results: 
- 
-//​Listview//​ 
-<code html> 
- 
-<ul> 
-    <​we:​listview type="​document"​ order="​we_published"​ desc="​true"​ rows="​10">​ 
-        <​we:​repeat>​ 
-            <li> 
-                <​b><​we:​field name="​headline"​ alt="​we_title"​ hyperlink="​true"/></​b><​br>​ 
-                <​we:​ifFieldNotEmpty name="​image"​ type="​img">​ 
-                    <​we:​field type="​img"​ name="​image"​ /><​br>​ 
-                </​we:​ifFieldNotEmpty>​ 
-                <​we:​field type="​text"​ name="​teaser"​ hyperlink="​true"​ alt="​description"​ max="​255"​ striphtml="​true"​ /> 
-            </li> 
-        </​we:​repeat>​ 
-        <​we:​ifBack>​ 
-            <​we:​back>​Back</​we:​back>​ 
-        </​we:​ifBack>​ 
-        <​we:​ifNext>​ 
-            <​we:​next>​Next</​we:​next>​ 
-        </​we:​ifNext>​ 
-    </​we:​listview>​ 
-</ul> 
-</​code>​ 
- 
-Look at the field-tag and it's name attribute: 
-<code html><​we:​field name="​headline"​ alt="​we_title"​ hyperlink="​true"/></​code>​ 
- 
-The template only reads headlines of documents that contain the tag: 
-<code html><​we:​input name="​headline"​ .../></​code>​ 
- 
-So be consistent with naming your document contents, if you want to list documents with more than one template! 
-Get used to a system like: 
-  * headline 
-  * teaser 
-  * text 
- 
-or similar, and stick to it!  
-Other template fields that are unique to their templates don't have to be consistent, but as they are case-sensitive,​ develop a code guideline -- and stick to it! 
- 
-**Do:** 
-<code html> 
-<!-- all small caps, spaces are underscores for legibility and compatibility --> 
-<​we:​input name="​city_or_country"​ type="​text"/>​ 
-<!-- as above, with CamelCase --> 
-<​we:​input name="​CityOrCountry"​ type="​text"/>​ 
-</​code>​ 
- 
-**Don'​t:​** 
-<code html> 
-<!-- You won't remember the exact name and maybe try CityOrCountry?​ --> 
-<​we:​input name="​Cityorcountry"​ type="​text"/>​ 
-<!-- Don't use spaces or other special characters, because the fieldnames are used as php variable names --> 
-<​we:​input name="​city or country"​ type="​text"/>​ 
-</​code>​ 
- 
-//(TODO: This will probably have to go into a new page)// 
en/webedition/beginners-guide/listviews.1549747599.txt.bz2 · Zuletzt geändert: 2019/02/09 22:26 von Sascha Nemecek

Recent changes RSS feed