Conditional HTML Content
Depending on the layout chosen, some content needs less or more HTML elements containing the pure information delivered by ctcreport. By conditionally defining user variables, this can be achieved.
These definitions are embedded in HTML comments with the general structure:
<!-- CTC_DEFINE("_UserVariable" "Condition" "HTML-Fragment if Condition is TRUE" "HTML-Fragment if Condition is FALSE") -->
It is recommended to start user variable names with an underscore.
The following conditions are available:
- Level2Available
- True if a layout with two levels of information is chosen for current page (overview / detail).
- SourceDrillable
- Independently for level 1 and level 2, this condition is true if:
- the source code view is generated by layout choice and
- the entity on the level is file or function.
- DetailDrillable
- This condition at overview page is true for the entity detail pages are generated for.
- JustificationsIncluded
- True if the report is generated with option
-include-justifications
. - OverviewLevel1Linked
- This condition is used on detail pages. It is true if the detail pages are generated for level 1 from overview page. It is used to structure the sibling navigation conditionally.
Example: One or two entities in table caption
In table headers in overview and detail pages, the one or two reported entities are
mentioned using this definition of $_Entities$
:
<!-- CTC_DEFINE("_Entities" "Level2Available" "$Level1Entities$ and $Level2Entities$" "$Level1Entities$") -->