Project

General

Profile

Actions

Feature proposal #5947

open

CBLib: Implement layout api

Added by krileon over 8 years ago. Updated about 6 years ago.

Status:
Assigned
Priority:
Normal
Assignee:
Target version:
Start date:
04 May 2016
Due date:
% Done:

0%

Estimated time:

Description

Instead of hardcoding Bootstrap or framework classes create a params array of them mapped to generic names. Example usage with Bootstrap being upgraded from 3 to 4 only needing minor changes.

Bootstrap 3:
Application::Layout()->get( 'box.container' ) // .panel
Application::Layout()->get( 'box.header' ) // .panel-header
Application::Layout()->get( 'box.title' ) // .panel-title

Bootstrap 4:
Application::Layout()->get( 'box.container' ) // .card
Application::Layout()->get( 'box.header' ) // .card-header
Application::Layout()->get( 'box.title' ) // .card-title

This should be done at the same time as Bootstrap 4 upgrade to easy future upgrades. If possible shorten the usage further to something like CBLayout( 'path' ). Shorter the better as this will be used.. a lot.


Files

layout_examples.txt (1.32 KB) layout_examples.txt krileon, 09 May 2016 22:21
Actions #1

Updated by krileon over 8 years ago

The layout class should also be able to path to template files. This will avoid duplicating template loader functions used in various plugins. Should also be capable of overriding layouts via Joomla template layout overrides as well.

Actions #3

Updated by krileon over 8 years ago

Right, but this would be a global layout API to be used by any plugin that also handles the CSS framework markup. Joomla has an interesting approach to the markup as follows.

JHtml::_('bootstrap.addTab', 'myTab', 'groups', JText::_('COM_USERS_ASSIGNED_GROUPS', true))
TAB CONTENTS HERE
JHtml::_('bootstrap.endTab')

Actions #4

Updated by beat over 8 years ago

There is also a new layouts proposal in Joomla that might go into 3.6, 3.7 or 4.0 (the discussion is still open)

Actions #5

Updated by krileon over 8 years ago

After some research I believe the below could provide a lot of usability.

SEE ATTACHED FILE (mod_security keeps rejecting inline)

These are just design ideas however and as I come up with more and do more research will provide them here.

Actions #6

Updated by krileon about 8 years ago

  • Target version changed from CB 2.1 to CB 3.0
Actions #7

Updated by krileon over 6 years ago

Potential PHP Template Libraries:
Twig - https://twig.symfony.com/
Blade - https://laravel.com/docs/5.6/blade

Potential JS Template Libraries:
VueJS - https://vuejs.org/

Actions #8

Updated by krileon about 6 years ago

  • Subject changed from Implement layout css library class to CBLib: Implement layout api
Actions

Also available in: Atom PDF