How to position the creatdate and author fields in same row Topic is solved

Moderator: mcsmom

Post Reply
unseenfootage

How to position the creatdate and author fields in same row

Post by unseenfootage » Wed Feb 27, 2008 5:27 am

Edit the following file : ../components/com_content/content.html.php

Replace this code - lines 801 to 839.
/**
* Writes Author name
*/
function Author( &$row, &$params ) {
if ( ( $params->get( 'author' ) ) && ( $row->author != '' ) ) {
?>
<tr>
<td width="70%" align="left" valign="top" colspan="2">
<span class="small">
<?php echo _WRITTEN_BY . ' '.( $row->created_by_alias ? $row->created_by_alias : $row->author ); ?>
</span>
  
</td>
</tr>
<?php
}
}


/**
* Writes Create Date
*/
function CreateDate( &$row, &$params ) {
$create_date = null;

if ( intval( $row->created ) != 0 ) {
$create_date = mosFormatDate( $row->created );
}

if ( $params->get( 'createdate' ) ) {
?>
<tr>
<td valign="top" colspan="2" class="createdate">
<?php echo $create_date; ?>
</td>
</tr>
<?php
}
}

with the following code:
/**
* Writes Author name
*/
function Author( &$row, &$params ) {
if ( ( $params->get( 'author' ) ) && ( $row->author != '' ) ) {
?>
<tr>
<td width="35%" align="left" valign="top" class="authoralias">
<span class="small">
<?php echo _WRITTEN_BY . ' '.( $row->created_by_alias ? $row->created_by_alias : $row->author ); ?>
</span>
  
</td>

<?php
}
}

/**
* Writes Create Date
*/
function CreateDate( &$row, &$params ) {
$create_date = null;

if ( intval( $row->created ) != 0 ) {
$create_date = mosFormatDate( $row->created );
}

if ( $params->get( 'createdate' ) ) {
?>

<td width="35%" align="right" valign="top" class="createdate">
<?php echo $create_date; ?>
</td>
</tr>
<?php
}
}
Finally , edit the file templates/yourtemplate/css/template_css.css and modify the createdate class :
.createdate {
/* see primary style css */
height: 20px;
vertical-align: top;
vertical-align: top;
padding-bottom: 5px;
padding-top: 0px;
}

, as per your requirements.

Good luck!

RedEye
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat Jan 21, 2006 8:42 pm

Re: How to position the creatdate and author fields in same row

Post by RedEye » Mon Mar 03, 2008 10:51 am

sry but to change the core for this is a bad way, when you make an update your code will be deleted
for example look in the ja_purity template to see the right way for doing this, you find there a folder html in this a folder com_content


Post Reply