How to change list heading

Status
Not open for further replies.

oreolana

Member
Hello,
Where I can change list view (like heading or fields labels)?
Look attachments.
 

Attachments

  • default_heading.JPG
    default_heading.JPG
    26 KB · Views: 441
  • my_heading.JPG
    my_heading.JPG
    35.8 KB · Views: 445
I want to merge cells (of heading). (like in MS Excel). And I want to numder columns.

[Text of heading]
-----------------------------------------------------------------------------------------------
|_______________________Total______________________________________|
-----------------------------------------------------------------------------------------------
|________Among them_______|____________________including_____________|
-----------------------------------------------------------------------------------------------
|__param for_|___param for___| param for___|_param for____|_____param for__|
|report period|previous period|report period plan|report period fact|previous period plan|
-----------------------------------------------------------------------------------------------
|______1____|______2______|______3____|___4________|________5______|
-----------------------------------------------------------------------------------------------
[ Then Values of table]
|__value 1,1__|___value 2,1___|__value 3,1__|___value 4,1__|___value 5,1_____|
-----------------------------------------------------------------------------------------------
|__value 1,2__|___value 2,2___|__value 3,2__|___value 4,2__|___value 5,2_____|
-----------------------------------------------------------------------------------------------
.................................. other values.......................
 
How I can modify each column's title in the table headind?
What is syntax I must to write in file mytemplate_headings.php?

I mean if I want to change third column (by name {entity____entity_full_name}) in the second list (by name {entity}). What syntax must be?

Would you write one or two examples for me?

thanks in advance
 
If you want to change the column heading text (that's what Felixkat was asking) you can do it in your element's "List view settings".

To create merged heading cells you must do it in a custom template with php and HTML.
To create a custom template copy an exiting template folder (e.g. default), rename it, but leave all file names and subfolders in this folder unchanged;
so your template folder may be "mytemplate" but it must contain the files default.php, default_headings.php...
 
I'm sorry.

I want to create merged heading cells you must do it in a custom template with php and HTML.
But I don't understand, how I can do it.
Maybe you have something examples?

What files I must will change?
Or maybe, what instruments I must use?

e.g., If I want to create merged heading cells (cell1=entity_full_name, cell2=entity_number), what I must to do? My actions by steps.

I'm sorry. I'm only begginer. But I want to known.
 
Edit default_headings.php in your custom template
Assuming the 5 columns form your example put something like
<tr>
<th colspan="5">Total</th>
</tr>
<tr>
<th colspan="2">Among them</th>
<th colspan="3">including</th>

</tr>
at the beginning. You may add CSS styles or classes.
 
Thanks.

I understand html.
Look, I did automatic numerqation of table's columns. I'm circle it by red colour.

I understood, if I want to create merged heading cells IN THE BEGINING I us your code.

Code:
<tr>
<th colspan="5">Total</th>
</tr>
<tr>
<th colspan="2">Among them</th>
<th colspan="3">including</th>

</tr>

Thank you.

But what can I do, if I want to create merged columns in the middle (like cell that I circle by green colour)?

I tried something like (this my file of new template /list/dbme/default_headings.php):
PHP:
<tr class="fabrik___heading">
<?php foreach ($this->headings as $key => $heading) {
        $style = empty($this->headingClass[$key]['style']) ? '' : 'style="'.$this->headingClass[$key]['style'].'"';?>
        <th class="<?php echo $this->headingClass[$key]['class']?>" <?php echo $style?>>
                <span class="heading">

/* This is my code about merged cells in the middle of the table */
                <?php if ($this->heading['tablename_elementname']) { ?>
                <tr><th colspan="2">Period</th></tr>
                 <?php }; ?>
/* The end of code */

                <?php echo  $heading; ?></span>
                <?php if (array_key_exists($key, $this->filters) && ($this->filterMode === 3 || $this->filterMode === 4)) {
                        $filter = $this->filters[$key];
                        $required = $filter->required == 1 ? ' notempty' : '';
                        echo '<div class="listfilter' . $required . '">
                        <span>' . $filter->element . '</span></div>';
                }?>
        </th>
        <?php }?>
</tr>

/* This is my code about automation numeric columns of the table */
<tr>
<?php
$numeracia=1;
foreach ($this->headings as $key => $heading) { ?>
<th>
<?php
echo $numeracia;
$numeracia++;
?>
</th>
<?php
};
?>
</tr>
/* The end of code */


And instead of 'tablename_elementname' I used real names, e.g. 'dbme_head___date_start_work'
Can you help me?
I tried many variants. Maybe you known right variant.

Thanks in advanced.
 

Attachments

  • merge.JPG
    merge.JPG
    40.1 KB · Views: 363
I understood, how it must be.

My table is like on the picture below.

My code is (on my_template/default_headings.php):
PHP:
<?php /* The template of the table ??????? 8.1 Addition 8.1 */ ?>
<?php if ($this->table->id == 26) { ?>
<tr class="fabrik___heading">
<?php foreach ($this->headings as $key => $heading) {
        $style = empty($this->headingClass[$key]['style']) ? '' : 'style="'.$this->headingClass[$key]['style'].'"';?>
        <?php if ($key == dbme_entity_performance___entity_full_name ||
        $key == dbme_entity_performance___agency_coordinated_or_provided_permission_to_exclusion ||
        $key == dbme_entity_performance___way_of_sale_of_assets ||
        $key == dbme_entity_performance___balance_residual_value_object_of_alienation ||
        $key == dbme_entity_performance___result_of_independent_evaluation_assets_initial_value_alienation ||
        $key == dbme_entity_performance___cost_of_sales_alienation ||
        $key == dbme_entity_performance___received_money_alienation ||
        $key == fabrik_select || $key == fabrik_actions) { ?>
        <th rowspan="2" class="<?php echo $this->headingClass[$key]['class']?>" <?php echo $style?>>
                <span class="heading"><?php echo $heading; }
                else if ($key == dbme_entity_performance___alienated_real_property_or_part) { ?>
                <th colspan="3" class="<?php echo $this->headingClass[$key]['class']?>" <?php echo $style?>>
                <span class="heading"><?php echo "Obektu, za yakumu prujnyato upravlinski rishennya"; } ?></span>
                <?php if (array_key_exists($key, $this->filters) && ($this->filterMode === 3 || $this->filterMode === 4)) {
                        $filter = $this->filters[$key];
                        $required = $filter->required == 1 ? ' notempty' : '';
                        echo '<div class="listfilter' . $required . '">
                        <span>' . $filter->element . '</span></div>';
                }?>
        </th>
        <?php }?>
</tr>
<tr class="fabrik___heading">
<?php foreach ($this->headings as $key => $heading) {
        $style = empty($this->headingClass[$key]['style']) ? '' : 'style="'.$this->headingClass[$key]['style'].'"';?>
        <?php if ($key == dbme_entity_performance___alienated_real_property_or_part ||
                  $key == dbme_entity_performance___alienated_other_separate_individually_defined_property ||
                  $key == dbme_entity_performance___alienated_land) { ?>
        <th class="<?php echo $this->headingClass[$key]['class']?>" <?php echo $style?>>
                <span class="heading"><?php echo $heading; } ?></span>
                <?php if (array_key_exists($key, $this->filters) && ($this->filterMode === 3 || $this->filterMode === 4)) {
                        $filter = $this->filters[$key];
                        $required = $filter->required == 1 ? ' notempty' : '';
                        echo '<div class="listfilter' . $required . '">
                        <span>' . $filter->element . '</span></div>';
                }?>
        </th>
        <?php }?>
</tr>
<tr>
<?php $numeracia=1;
foreach ($this->headings as $key => $heading) {
        $style = empty($this->headingClass[$key]['style']) ? '' : 'style="'.$this->headingClass[$key]['style'].'"';?>
        <th class="<?php echo $this->headingClass[$key]['class']?>" <?php echo $style?>>
                <span class="heading"><?php echo $numeracia; $numeracia++; ?></span>
        </th>
        <?php }?>
</tr>
<?php }; ?>

Maybe this code help for someone.
 

Attachments

  • merged_cells_in_heading.JPG
    merged_cells_in_heading.JPG
    65 KB · Views: 384
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top