Hi all! Just to get your minds flowing, i'd like to give you a brief
introduction, what the "Elements" are in Edicy and what they can do.
As i said in a previous message, one can define custom objects with
fields that user can later fill these in to create objects. These
objects can be later searched, filtered or sorted in page template.
I'll start with a brief example. Lets say that we want to add a list
of books to the site. In Edicy, there is an option to define object
"Book" with it's attributes, for example:
* Title
* Author
* ISBN
* Cover photo
* Description
* Genre
Now let's imagine that user has already entered some books on the
site. To list all books, the page template may look like this:
<!-- Render the list of books on page -->
{% for book in elements %}
<div class="book">
<h2><a href="{{ book.url }}">{{ book.title }}</a></h2>
<p>{{ book.author }} - {{ book.isbn }}</p>
<img src="{{ book.cover_photo }}" alt="" />
</div>
{% endfor %}
A special variable named "elements" is available on page that is
marked as elements page (it can be specified in page template type).
This variable contains a list of elements associated with this page.
There can be multiple pages containing different objects or even
objects of different types (e.g "Book" and "Magazine").
Each object has its own page with its own url (notice the
{{ book.url }} property). To this page you can create another
template, that displays the information only for the given book. On
this page, a special variable called "element" is available.
<!-- Render the title and description for selected book -->
<h2>{{ element.title }}</h2>
<div class="genre">{{ element.genre }}</div>
<div class="description">{{ element.description }}</div>
On any other page, elements can be loaded through special {%
elementscontext %} block, where the special "elements" variable is
available. Additional attributes can be provided in the block tag,
which filter the elements to be assigned inside the block:
<!-- Render only the fiction books -->
{% elementscontext genre="Fiction" %}
{% for book in elements %}
<h2><a href="{{ book.url }}">{{ book.title }}</a></h2>
{% endfor %}
{% endelementscontext %}
This "Elements" feature works well for certain scenarios -- usually
for sites where one might want to have a simple database of things
that must be listed on site and nothing more. It does not attempt to
replace databases or applications that are more complex than that.
I'd like to end this message with a real-life example of lawyer firm
site
http://www.varul.com This site is built using several different
object types -- notice the "Publications", "Practices" and "People"
sections. These listings are being built with elements. Also notice
that publications are associated with people and practices.
Associations can be created between different kind of objects, however
this is something that is in very early beta stage.
I hope you find this overview useful and if you have any questions,
please do not hesitate to ask.
Best,
Priit Haamer
Edicy.