Benutzer-Werkzeuge

Webseiten-Werkzeuge


en:webedition:beginners-guide:listviews

Dies ist eine alte Version des Dokuments!


A PCRE internal error occured. This might be caused by a faulty plugin

===== Listing Documents (we:listview) ===== This shows 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> <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><we:field name="headline" alt="we_title" hyperlink="true"/></code> The template only reads headlines of documents that contain the tag: <code><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> <!-- 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> <!-- 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.1549625714.txt.bz2 · Zuletzt geändert: 2019/02/08 12:35 von Rudolf Horbas

Recent changes RSS feed