改变Joomla分类内容表格宽度、位置(change table width,height for joomla)
Joomla分类内容的表格的宽度和位置是固定写在程序中的,而且还比较难看,我们就来改一把
修改后的效果:效果演示
在 componentscom_contentcontent.html.php 的 240 行左右
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
if ( $params->get( 'headings' ) ) { ?> <tr> <?php if ( $params->get( 'date' ) ) { ?> <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" width="30%"> <?php echo _DATE; ?> </td> <?php } if ( $params->get( 'title' ) ) { ?> <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>"> <?php echo _HEADER_TITLE; ?> </td> <?php } if ( $params->get( 'author' ) ) { ?> <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" align="left" width="20%"> <?php echo _HEADER_AUTHOR; ?> </td> <?php } if ( $params->get( 'hits' ) ) { ?> <td align="center" class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" width="10%"> <?php echo _HEADER_HITS; ?> </td> <?php } ?> </tr> <?php } |
改变为:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
if ( $params->get( 'headings' ) ) { ?> <tr> <?php if ( $params->get( 'date' ) ) { ?> <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" width="15%"align="center"> <?php echo _DATE; ?> </td> <?php } if ( $params->get( 'title' ) ) { ?> <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" align="left"> <?php echo _HEADER_TITLE; ?> </td> <?php } if ( $params->get( 'author' ) ) { ?> <td class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" align="center" width="15%"> <?php echo _HEADER_AUTHOR; ?> </td> <?php } if ( $params->get( 'hits' ) ) { ?> <td align="center" class="sectiontableheader<?php echo $params->get( 'pageclass_sfx' ); ?>" width="5%"> <?php echo _HEADER_HITS; ?> </td> <?php } ?> </tr> <?php } |
这时标题已经和内容的百分比已经设置好了,就是修改了其中的width和align属性值,如果想设置内容的对齐方式的话,再往下看
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
$k = 0; foreach ( $items as $row ) { $row->created = mosFormatDate ($row->created, $params->get( 'date_format' )); // calculate Itemid HTML_content::_Itemid( $row ); ?> <tr class="sectiontableentry<?php echo ($k+1) . $params->get( 'pageclass_sfx' ); ?>" > <?php if ( $params->get( 'date' ) ) { ?> <td> <?php echo $row->created; ?> </td> <?php } if ( $params->get( 'title' ) ) { if( $row->access <= $gid ){ $link = sefRelToAbs( 'index.php?option=com_content&task=view&id='. $row->id .'&Itemid='. $Itemid ); ?> <td> <a href="<?php echo $link; ?>"> <?php echo $row->title; ?> </a> <?php HTML_content::EditIcon( $row, $params, $access ); ?> </td> <?php } else { ?> <td> <?php echo $row->title .' : '; $link = sefRelToAbs( 'index.php?option=com_registration&task=register' ); ?> <a href="<?php echo $link; ?>"> <?php echo _READ_MORE_REGISTER; ?> </a> </td> <?php } } if ( $params->get( 'author' ) ) { ?> <td align="left"> <?php echo $row->created_by_alias ? $row->created_by_alias : $row->author; ?> </td> <?php } if ( $params->get( 'hits' ) ) { ?> <td align="center"> <?php echo $row->hits ? $row->hits : '-'; ?> </td> <?php } ?> </tr> <?php $k = 1 - $k; } |
把响应的 align=”left” 修改为center,right就可以了
Trackback from your site.