10 years ago
Topic
Hello,

I have a list that I display as a table with template seb_table.

I have multiple fields in one column, e.g. first name, last name, address.

Now each of fields gets displayed in a new row like this:
first name
last name
address

This is because they are wrapped like this
<div>first name</div>
<div>last name</div>
<div>address</div>

I need to display them like
first name last name
address

How can I get rid of the wrapping divs?
I tried different variations but no matter what variation I choose (Default, Empty, None,joomla, seb_css3, the output is always the same. See also my post here.

I also tried putting a file markup.php in seb_table/fields. The content of seb_table/fields/markup.php is
<?php
/**
* @version             SEBLOD 3.x Core
* @package            SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder)
* @url                http://www.seblod.com
* @editor            Octopoos - www.octopoos.com
* @copyright        Copyright (C) 2013 SEBLOD. All Rights Reserved.
* @license             GNU General Public License version 2 or later; see _LICENSE.php
**/

defined( '_JEXEC' ) or die;

// The markup around each field (label+value/form) can be Overridden.
// Remove the underscore [_] from the Filename. (filename = markup.php)
// Edit the function name:
//    - fields/markup.php             =>    cckMarkup_[template]
//    - fields/[contenttype]/markup.php    =>    cckMarkup_[template]_[contenttype]
//    - fields/[searchtype]/markup.php    =>    cckMarkup_[template]_[searchtype]
// Write your Custom Markup code. (see default markup below)

// cckMarkup
function cckMarkup_seb_table( $cck, $html, $field, $options )
{
    return $html;
}
?>
This method works fine for me in other templates (seb_blog, minima etc). But it seems to have no effect on the seb_table template output. The wrapping divs are still there.

How would you go about this?

Any answers would be really appreciated.
Get a VIP membership
10 years ago
0
Level 1
Thank you Zwergo,
your solution is fine. But I'm looking for a way to get rid of the cck divs that you applied the float to. If we can somehow avoid these divs, we have cleaner code and need less CSS rules.

Seblod variations and the markup.php in fields folder of the templates are supposed to handle these things. But they are not working for the seb_table template, it seems.

I was hoping to get some feedback from the developers to clarify how we can remove those wrapping divs.
127 Posts
Cappu
10 years ago
0
Level 1
Hi gebeer,

to solve this, I would consider to do a HTML overwrite. But, looks like there is no way to HTML overwrite tables. - (Quite confusing for a newbie what Templates we may overwrite or not, anyways).

Besides that, to wrap each field output in a div is acceptable. I would try to use CSS (display: inline-block;, float: left;, position:relative;) to display them in one line.

Bernhard
10 years ago
0
Level 1
Hello Bernhard,

thanks for the input. Yep, the CSS way seems the only solution at the moment.

And I find it quite confusing, too, that overrides for table template are not possible.

It seems that even variations don't work. I was hoping to get some "official" feedback from the developers on that.
10 years ago
0
Level 1

I guess the trouble for the SEBLOD team is, that not all html elements allow for as detailed control as the div element,
because they just don't have particular attributes or react in a different way.
To be able to position / move stuff around and style it reliably, divs are added everywhere.

That's a one-suits-all solution, bu I don't think that it is the final solution,
especially when no particular style or class is applied by the developer.

A check for necessity of the div element would make the output even cleaner,
and wrapping divs would be published only when necessary.

4229 Posts
Kadministrator
10 years ago
1
Level 1

Put HTML typography like bellow on the first of those fields and put the rest of those fields into hidden position or put typography Clear on them:

$cck->getValue('field1') $cck->getValue('field2') $cck->getValue('field3')
10 years ago
0
Level 2

Thank you Klas. That looks like a great workaround.

Get a VIP membership