{"action":"closed","issue":{"url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/624","labels_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/624/labels{/name}","comments_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/624/comments","events_url":"https://api.github.com/repos/backdrop/backdrop-issues/issues/624/events","html_url":"https://github.com/backdrop/backdrop-issues/issues/624","id":54894754,"number":624,"title":"Create a great api for designers","user":{"login":"philippejadin","id":1199349,"avatar_url":"https://avatars.githubusercontent.com/u/1199349?v=3","gravatar_id":"","url":"https://api.github.com/users/philippejadin","html_url":"https://github.com/philippejadin","followers_url":"https://api.github.com/users/philippejadin/followers","following_url":"https://api.github.com/users/philippejadin/following{/other_user}","gists_url":"https://api.github.com/users/philippejadin/gists{/gist_id}","starred_url":"https://api.github.com/users/philippejadin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philippejadin/subscriptions","organizations_url":"https://api.github.com/users/philippejadin/orgs","repos_url":"https://api.github.com/users/philippejadin/repos","events_url":"https://api.github.com/users/philippejadin/events{/privacy}","received_events_url":"https://api.github.com/users/philippejadin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-20T15:16:37Z","updated_at":"2015-03-17T13:25:36Z","closed_at":"2015-03-17T13:25:36Z","body":"Please work on an enhanced api that designers (themers) will understand.\r\n\r\nToday again I tried (and failed) to theme links in Drupal 7. A royal pain.\r\n\r\nI don't want to use theme preprocessing function. I don't want to use render arrays. Ever. I will not touch or learn this.\r\n\r\nI'd like to see simple templates using simple, fail proof objects and simple render functions. I want to use simple php to control it all.\r\n\r\nIt's not evil to have display logic in template. It is evil (to a poor themer) to put presentation logic in a separate file with crazy syntax.\r\n\r\nI want to do that : \r\n```php\r\n<?php foreach ($comments as $comment): ?>\r\n\r\n<?php print ($comment->title) ?>\r\n\r\n<a href=\"<?php print ($comment->author->url) ?>\">\r\n<?php print ($comment->author->name); ?>\r\n</a>\r\n\r\n<?php print($comment->body->filter('Simple HTML')); ?>\r\n\r\n<?php endforeach; ?>\r\n```\r\n\r\nOr that : \r\n\r\n```php\r\n$links->get('comments_add')->hide();\r\n\r\n<?php foreach ($links as $link): ?>\r\n<a href=\"<?php print $link->url; ?>\"><?php print $link->title->trim(50); ?></a>\r\n<?php endforeach; ?>\r\n```\r\n\r\nOr that : \r\n\r\n```php\r\n<?php if ($node->viewmode == 'teaser') : ?>\r\n<?php print ($node->fields->get('body')->trim(300)); ?>\r\n```\r\nFrankly, who will ever understand this (taken from bootstrap theme): \r\n\r\n```php\r\nfunction bootstrap_preprocess_breadcrumb(&$variables) {\r\n  $breadcrumb = &$variables['breadcrumb'];\r\n\r\n  // Optionally get rid of the homepage link.\r\n  $show_breadcrumb_home = theme_get_setting('bootstrap_breadcrumb_home');\r\n  if (!$show_breadcrumb_home) {\r\n    array_shift($breadcrumb);\r\n  }\r\n\r\n  if (theme_get_setting('bootstrap_breadcrumb_title') && !empty($breadcrumb)) {\r\n    $item = menu_get_item();\r\n    $breadcrumb[] = array(\r\n      // If we are on a non-default tab, use the tab's title.\r\n      'data' => !empty($item['tab_parent']) ? check_plain($item['title']) : drupal_get_title(),\r\n      'class' => array('active'),\r\n    );\r\n  }\r\n}\r\n```\r\n\r\nInstead I'd like to see this : \r\n\r\n```php\r\n<?php foreach ($breadcrumbs as $breadcrumb): ?>\r\n\r\n    <a href=\"<?php print $breadcrumb->url; ?>\"><?php print $breadcrumb->title->trim(50); ?></a>\r\n    <?php \r\n    if (!$breadcrumb->isLast())\r\n    {\r\n        print '>';\r\n    }\r\n    ?>\r\n\r\n<?php endforeach; ?>\r\n```\r\n\r\n\r\nAnd play with whatever iterator system there is in php object to make life easier and more understandable.\r\n\r\nStart to document the ideal system (from a themer perspective), then implement it.\r\n\r\nYes this was a rant :-) I have huge hope for Backdrop."}}