Project

General

Profile

Actions

Feature proposal #6353

closed

Rewrite how template files are included

Added by krileon over 7 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
19 December 2016
Due date:
% Done:

100%

Estimated time:

Description

Currently it uses a Class > Function usage. The problem with this is if you include it more than once it errors. This means you can't have per-stream template usage. Instead the template function should return a URL path that can then be output via a require call. This is in short how Joomla layouts function.

See CB Core Fields Ajax for first implementation of this new template usage.

Actions #1

Updated by krileon about 7 years ago

  • Target version changed from 4.0.0 to 6.0.0
Actions #2

Updated by krileon about 7 years ago

This should move as much as possible the logic out of the template files. For example the menu parsing should just be an array given to the template instead of a mass of IF checks. The templates need to be as much HTML and as minimal PHP as possible.

Actions #3

Updated by krileon over 6 years ago

Follow CB Package Builder template usage. Also implement support for paths in template file usages (e.g. core_activity/parse) to allow for nested template files for better organization (e.g. comments/edit, comments/comment, etc..).

Actions #4

Updated by krileon about 5 years ago

  • Target version changed from 6.0.0 to 5.0.0
Actions #5

Updated by krileon almost 5 years ago

  • % Done changed from 0 to 10
Actions #6

Updated by krileon almost 5 years ago

  • % Done changed from 10 to 30

Template files are also being split into more smaller template files. This will give greater control over styling. For example tags.php is now tags.php, tags_rows.php, and tag_container.php. This will for example allow overriding how the rows grid is styled without having to touch the other templates minimizing what you need to edit and replace.

In addition to this a lot of the PHP is being moved out of the template files (as much as possible) to the component to make it easier to edit the styling without breaking logic.

Actions #7

Updated by krileon almost 5 years ago

  • % Done changed from 30 to 50

Likes, Following, and Tags templates all rewritten.

Actions #8

Updated by krileon almost 5 years ago

  • % Done changed from 50 to 60

Template files are now being organized into subfolders for better organization. For example all core activity handling will be in the "core" folder. Example as follows.

/core/display/login.php
/core/display/logout.php
/core/access.php
/core/source.php
/core/display.php

Actions #9

Updated by krileon almost 5 years ago

  • % Done changed from 60 to 90

Needs stream parameter to select template on a per stream basis. All template files have now been rewritten.

Actions #10

Updated by krileon almost 5 years ago

  • % Done changed from 90 to 80

attachment template files still need some work

Actions #11

Updated by krileon almost 5 years ago

  • % Done changed from 80 to 90

per-stream template parameter now implemented for Activity, Comments, Notifications, Tags, Likes, and Follows.

Actions #12

Updated by krileon almost 5 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 90 to 100
Actions #13

Updated by krileon almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF