WpLatte HTML Templates

Updated: April 5, 2012, 2:45 pm

Please read the following documents in order to fully understand Latte templating system:

Conventions

File names have the following prefixes:

  • main-main Latte template that is read within individual WordPress controller php file, please read WpLatte architecture for more info
  • general-general template that does not depend on any particular data. This template can access global data that are included in ait-bootstrap.php. General template is for example template with search form, it’ll be called general-search-form.html
  • snippet-templates that can be included from main templates or from any parent snippet templates. Snippet templates depend on data. For example snippet-comments.html can be included from main-page.html or main-single.html

Suffix, e.g. .php, is there because we want to be able to see and maybe edit templates inside theme editor in WordPress admin.

WpLatte Macros

Beside default macros that are defined in Nete\Latte we implemented several WpLatte macros. WpLatte macro definitions can be found in AIT/Framework/WpLatte/WpLatteMacros.php

  • {dynamicSidebar}  - alias for dynamic_sidebar()
  • {head} – alias for wp_head()
  • {footer} – detto
  • {menu} – alias for wp_nav_menu()
  • {title} – prints title into <title></title>
  • {editPostLink} – alias for edit_post_link()
  • {editCommentLink} – edit comments link
  • {postContentPager} – pagination macro for the particular post. Post will be automatically paginated if you insert <!–nextpage–> into post content.
  • {commentForm} – alias for comment_form function
  • {prevCommentsLink} – alias for previous_comments_link function
  • {nextCommentsLink} – alias for next_comments_link function
  • {prevPostsLink} – alias for previous_posts_link function
  • {nextPostsLink} - alias for next_posts_link function
  • {commentTitle} – prints title above comments
  • {commentReplyLink} – prints “Reply &darr;” link
  • {listComments} {/listComments} – pair macro, that will print all comments including child comments.