|
A Quick Start Guide
In this Quick Start Guide we are going to create a basic content page. This contentpage consists of a controller/action and a view.
First I recommend you to read the overview. This helps you to understand what we are doing here. Furthermore I recommend you to read the documents-page. This page explains you what we are doing here.
Together with this Quick Start Guide you should be able to understand Eicra documents in general.
The first few steps will be done directly in the code. Only for the last steps we are logging into the backend.
As mentioned already before, Eicra uses Zend_View as its template engine, and the standard template language is PHP.
The product implementation of Zend_View offers special methods to increase the usability:
Some Examples
There are some properties which are automatic available in the view: You can use your own custom Zend_View helpers, or create some new one to make your life easier.
Editable (Placeholders for content)
We offer a basic set of placeholders which can be placed directly into the template. In editmode they appear as an editable widget, where you can put your content in. While in frontend-mode the content is directly embedded into the HTML. There is a standard scheme for how to call the editables. The first argument is always the name of the element (as string), the second argument is an array with multiple options (configurations) in it. Example<!-- creates a input in editmode (admin) and directly outputs the text in frontend --> <h1><?= $this->input("headline", array("width" => 540)); ?></h1> <!-- advances template --> <?php $this->layout()->setLayout('standard'); ?> <h1><?= $this->input("headline", array("width" => 540)); ?></h1> <h1><?= $this->numeric("number", array("width" => 540)); ?></h1> <?php while ($this->block("contentblock")->enumerate()) { ?> <?php if($this->editmode) { ?> <?= $this->select("blocktype",array( "store" => array( array("wysiwyg", "WYSIWYG"), array("contentimages", "WYSIWYG with images"), array("video", "Video") ), "onchange" => "editWindow.reload.bind(editWindow)" )); ?> <?php } ?> <?php if(!$this->select("blocktype")->isEmpty()) { $this->template("content/blocks/".$this->select("blocktype")->getData().".php"); } ?> <?php } ?>
|