Processwire: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
Zeile 16: Zeile 16:
  
 
== ProcessWire Snippets ==
 
== ProcessWire Snippets ==
−
=== Breadcrumb ===
+
[[ProcessWire - Snippets]]
−
<pre>
 
−
<!-- breadcrumbs -->
 
−
<div class='breadcrumbs'><?php
 
−
// breadcrumbs are the current page's parents
 
−
foreach($page->parents() as $item) {
 
−
echo "<span><a href='$item->url'>$item->title</a></span> ";
 
−
}
 
−
// optionally output the current page as the last item
 
−
echo "<span>$page->title</span> ";
 
−
?></div>
 
−
</pre>
 
  
−
=== Searchbar ===
 
−
<pre>
 
−
<!-- search form-->
 
−
<form class='search' action='<?php echo $pages->get('template=search')->url; ?>' method='get'>
 
−
<input type='text' name='q' placeholder='Search' value='<?php echo $sanitizer->entities($input->whitelist('q')); ?>' />
 
−
<button type='submit' name='submit'>Search</button>
 
−
</form>
 
−
 
−
</pre>
 
−
=== Topnav ===
 
−
1.Level
 
−
<pre>
 
−
<ul class='topnav'><?php
 
−
// top navigation consists of homepage and its visible children
 
−
foreach($homepage->and($homepage->children) as $item) {
 
−
if($item->id == $page->rootParent->id) {
 
−
echo "<li class='current'>";
 
−
} else {
 
−
echo "<li>";
 
−
}
 
−
echo "<a href='$item->url'>$item->title</a></li>";
 
−
}
 
−
// output an "Edit" link if this page happens to be editable by the current user
 
−
if($page->editable()) echo "<li class='edit'><a href='$page->editUrl'>Edit</a></li>";
 
−
?></ul>
 
−
</pre>
 
 
== Processwire - Templates ==
 
== Processwire - Templates ==
 
[[Processwire - Templates]]
 
[[Processwire - Templates]]

Version vom 16. Januar 2017, 12:33 Uhr

Links

http://cheatsheet.processwire.com/

Installation

  • Download
  • Aufrufen Installer durchführen. Es gibt ein paar nette Starter Templates
  • evtl. Über Module das schönere Reno Admin Template installieren (und im User Profil aktivieren)

Language Pack

Modules > Language > Language Support > install.
  • Neue Sprache hinzufügen
Setup > Languages > Add New Language. Enter a title and name for the language and save.
  • Dateien des Launguage Pack hinzufügen: Language Packs für das Backend kann man im Bereich Core Translation Files hochladen. Zip Files werden automatisch entpackt. Wenn das System das nicht unterstützt, kann man die JSON Dateien auspacken und direkt hochspielen.
  • Im Profil Sprache einstellen.

ProcessWire Snippets

ProcessWire - Snippets

Processwire - Templates

Processwire - Templates