Feature proposal #6353
closed
Rewrite how template files are included
Added by krileon almost 8 years ago.
Updated over 5 years ago.
Start date:
19 December 2016
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.
- Target version changed from 4.0.0 to 6.0.0
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.
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..).
- Target version changed from 6.0.0 to 5.0.0
- % Done changed from 0 to 10
- % 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.
- % Done changed from 30 to 50
Likes, Following, and Tags templates all rewritten.
- % 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
- % Done changed from 60 to 90
Needs stream parameter to select template on a per stream basis. All template files have now been rewritten.
- % Done changed from 90 to 80
attachment template files still need some work
- % Done changed from 80 to 90
per-stream template parameter now implemented for Activity, Comments, Notifications, Tags, Likes, and Follows.
- Status changed from Assigned to Resolved
- % Done changed from 90 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF