Ho do i change "sectiontableentry" to a new class?

13 years 1 month ago #26473 by Switch
What would I do in this case, if I didn't want to edit my main template, but instead wanted to add new css, such as .roweven and .rowodd for alternating rows. The following code tells the mablog which id to chose, but I want it use use my new css attributes.

[code:1] if($mosConfig_hits) {
$return .= "<th>".$this->_writeSortByLink($pagingParams,"entries_","hits",_UE_ARTICLEHITS)."</th>";
$return .= "</tr>";
$i = 2;
foreach($items as $item) {
if (is_callable( array( $mainframe, "getItemid" ) ) ) {
$itemid = $mainframe->getItemid( $item->id );
} elseif (is_callable( "JApplicationHelper::getItemid" ) ) {
$itemid = JApplicationHelper::getItemid( $item->id );
} else {
$itemid = null;
$itemidtxt = $itemid ? "&Itemid=" . (int) $itemid : "";
$i = ($i==1) ? 2 : 1;
$return .= "<tr class=\"sectiontableentry$i\"><td><a href=\"".$artURL.$item->id.$itemidtxt."\">".$item->title."</a></td>"
. "<td>".mosFormatDate($item->created)."</td>";
if($mosConfig_hits) $return.= "<td>".$item->hits."</td>\n";
$return .= "</tr>\n";

Does anyone knowhow to acheive this?
13 years 1 month ago #26474 by Switch
Gosh I feel silly. To change sectiontable entry to another class, just change [code:1]class=\"sectiontableentry$i\[/code:1] to for example [code:1]class=\"row$i\[/code:1]

Now, i couldn't use .roweven and .row odd, I used .row1 and .row2

Simply create thse css attribute in your css, eg
background: #E9EBF4;
color: #000000;
border-bottom:1px solid #EEEEEE;

background: #FFFFFF;
color: #000000;
border-bottom:1px solid #EEEEEE;

Easy as pie!
13 years 1 month ago #27053 by goofy001
I cheated, I just set both of them to the same background color. One day will actually change the class being used and stop being lazy :)
13 years 1 day ago #29577 by bary
great post
12 years 10 months ago #32875 by simon
Strange one here...

Has to do with the styling of the registration form..

Changed the styling of the td .delimiterCell bij adding this to my CSS

table#registrationTable .delimiterCell {

Did the trick...
Did the same thing to the td . titleCell

table#registrationTable .titleCell {

But is does not work..????
12 years 10 months ago #34155 by PretenderMP
my question is rather similar.. I just want the userlist to have the standard sectiontableentry1 and 2 css, but in the profile plugin I want other colours. It seems impossible to change. For instance the table with the user details has the sectiontableentry css, but I want different colour for that. I tried everything, including the $row thing, but without success.
Moderators: beatnantkrileon
Time to create page: 0.433 seconds

Facebook Twitter LinkedIn