Browse files

Link Feather title now is optional.

Changed 'name' to 'title' and made it optional. Close #36
All non-titled feathers will be updated and offered as separate downloads.
  • Loading branch information...
1 parent fbe8dd2 commit 1f0a9f222a3922bb66d865daed72d6d09eaa8e82 @xhezairi xhezairi committed Oct 26, 2011
Showing with 6 additions and 5 deletions.
  1. +5 −4 feathers/link/link.php
  2. +1 −1 themes/stardust/feathers/link.twig
View
9 feathers/link/link.php
@@ -1,14 +1,15 @@
<?php
class Link extends Feathers implements Feather {
public function __init() {
+ $this->setField(array("attr" => "name",
+ "type" => "text",
+ "label" => __("Title", "link"),
+ "optional" => true,
+ "bookmarklet" => "title"));
$this->setField(array("attr" => "source",
"type" => "text",
"label" => __("URL", "link"),
"bookmarklet" => "url"));
- $this->setField(array("attr" => "name",
- "type" => "text",
- "label" => __("Name", "link"),
- "bookmarklet" => "title"));
$this->setField(array("attr" => "description",
"type" => "text_block",
"label" => __("Description", "link"),
View
2 themes/stardust/feathers/link.twig
@@ -1,6 +1,6 @@
{% extends "content/post.twig" %}
{% block content %}
- <h2 class="title"><a href="$post.source" class="link">$post.name</a></h2>
+ <h2 class="title"><a href="$post.source" class="link">${ "%s" | format(post.name | fallback(post.source)) }</a></h2>
${ post.description | read_more }
{% endblock %}

0 comments on commit 1f0a9f2

Please sign in to comment.