Loading...
 

Line returns at the beginning and end of individual format sections of PluginList should be in auto-stripped to avoid extra height thickness (wasted space) while preserving code readability

Status
Pending
Priority
4 Good thing
Task
Line returns at the beginning and end of individual format sections of PluginList should be in auto-stripped to avoid extra height thickness (wasted space) while preserving code readability
Add a timesheet
Add a timesheet for this task
Description

If you compare the rendered table near the bottom of

  1. rendered table on page, at revision 46 ( source code)
  2. rendered table on page, at revision 47 ( source code)
  3. rendered table on page, at revision 49 ( source code)


...You will notice that the heights vary, and the 1st version (revision 46) is quite space-inefficient. The difference becomes even more drastic at revision 49 that combines some columns.

This is because the code was written nicely (to be human-readable), like so:

~
~

{OUTPUT}
  {FORMAT( name="TaskSummary")}
    {display default="" name="tracker_field_TaskSummary" format="objectlink"}
{FORMAT}
  {FORMAT( name="TaskPriority")}
    {display default="" name="tracker_field_TaskPriority" editable="inline" format="trackerrender"}
{FORMAT}
  {FORMAT( name="TaskJob")}
    {display default="" name="tracker_field_TaskJob" format="trackerrender"}
{FORMAT}
  {FORMAT( name="modification_date")}
    {display default="" name="modification_date" format="date"}
{FORMAT}

~
~


...however, in 24x and older, the only way to avoid extra line returns to be rendered in the output is to jam everything on one line (and use
to create linebreaks within the line), which prevents you from nicely formatting and indenting the code:

~
~

  {FORMAT( name="TaskSummary")} {display default="" name="tracker_field_TaskSummary" format="objectlink"} {FORMAT}
  {FORMAT( name="TaskPriority")} {display default="" name="tracker_field_TaskPriority" editable="inline" format="trackerrender"} {FORMAT}
  {FORMAT( name="TaskJob")} {display default="" name="tracker_field_TaskJob" format="trackerrender"} {FORMAT}
  {FORMAT( name="modification_date")} {display default="" name="modification_date" format="date"} {FORMAT}

~
~


Now that might not look _so_ bad, but really it gets unreadable when you try to combine the contents of multiple columns into one, like this:

~
~

  {FORMAT( name="TaskSummary")} {display default="" name="tracker_field_TaskSummary" format="objectlink"} %%% {display default="" name="tracker_field_TaskJob" format="trackerrender"} {FORMAT}
  {FORMAT( name="TaskPriority")} {display default="" name="tracker_field_TaskPriority" editable="inline" format="trackerrender"} {FORMAT}
  {FORMAT( name="modification_date")} {display default="" name="modification_date" format="date"} {FORMAT}

~
~


So, while we can write all-on-one line code, I believe Tiki's PluginList should do the smart thing and strip extra line returns before/after row/cell contents, in favor of code legibility.

Emails
Assigned to
developer
Assigned by
adrien.maloba
Keep informed
jonny.bradley, michael.imbeault
Also visible to
1- Visible to Anonymous (Public content)
Related
Created
Thursday 11 of August, 2022 15:39:36 EDT
by Jeff Fortin T.
LastModif
Wednesday 05 of October, 2022 00:58:47 EDT