NYCPHP Meetup

[joomla] is there a better way to accomplish this?

Rolan Yang rolan at omnistep.com
Thu Aug 2 13:04:00 EDT 2007


I implemented a design such that my com_content articles are enclosed in 
a lighter shade rounded-corners style box as can be seen in this example:
http://www.omnistep.com/joomlamods/

The css and html code to generate the rounded corners box was taken from 
http://www.spiffycorners.com/

To make this work across for the joomla content, I modified 
/content/com_content.html.php by hardcoding the css into the "function 
show()" script as can be seen below.
I thought this was kind of a dirty way to accomplish the task. Can 
anyone offer a better suggestion? I don't want to have to manually 
insert the rounded corner box html code when creating the articles. That 
would be too complicated for the end user content managers. Is there 
some sort of postfilter or mambot that can be used to accomplish this in 
more simple manner, perhaps one that would not require modifying the 
joomla source?


modified content.html.php:

   515                          <td valign="top" colspan="2">
   516                          <div>
   517    <b class="spiffy">
   518    <b class="spiffy1"><b></b></b>
   519    <b class="spiffy2"><b></b></b>
   520    <b class="spiffy3"></b>
   521    <b class="spiffy4"></b>
   522    <b class="spiffy5"></b></b>
   523
   524    <div class="spiffyfg">
   525                                  <?php
   526                                  // displays Table of Contents
   527                                  HTML_content::TOC( $row );
   528
   529                                  // displays Item Text
   530                                  echo ampReplace( $row->text );
   531                                  ?>
   532   </div>
   533
   534    <b class="spiffy">
   535    <b class="spiffy5"></b>
   536    <b class="spiffy4"></b>
   537    <b class="spiffy3"></b>
   538    <b class="spiffy2"><b></b></b>
   539    <b class="spiffy1"><b></b></b></b>
   540  </div>
   541                          </td>
   542                  </tr>
   543                  <?php
   544
   545                  // displays Modified Date
   546                  HTML_content::ModifiedDate( $row, $params );


css code:
.spiffy{display:block}
.spiffy *{
  display:block;
  height:1px;
  overflow:hidden;
  font-size:.01em;
  background:#f3f0e7}
.spiffy1{
  margin-left:3px;
  margin-right:3px;
  padding-left:1px;
  padding-right:1px;
  border-left:1px solid #f1efe6;
  border-right:1px solid #f1efe6;
  background:#f9f8f4}
.spiffy2{
  margin-left:1px;
  margin-right:1px;
  padding-right:1px;
  padding-left:1px;
  border-left:1px solid #eae5d8;
  border-right:1px solid #eae5d8;
  background:#faf9f6}
.spiffy3{
  margin-left:1px;
  margin-right:1px;
  border-left:1px solid #faf9f6;
  border-right:1px solid #faf9f6;}
.spiffy4{
  border-left:1px solid #f1efe6;
  border-right:1px solid #f1efe6}
.spiffy5{
  border-left:1px solid #f9f8f4;
  border-right:1px solid #f9f8f4}
.spiffyfg{
  background:#f3f0e7; padding:5px 5px 5px 5px;}












More information about the Joomla mailing list