11 years ago
16
Topic

Hello,

I need to produce clean code with no clutter for a client's site.

I already installed seb_minima to have minmal markup.

Still, when I render my articles, I get code like this:

<div id="cck13_mainbody" class="seb_css3 vertical cck13-deepest">
<div id="cck13_art_introtext" class="cck_contents cck_intro cck_wysiwyg_editor cck_art_introtext">
<div id="cck13_value_art_introtext" class="cck_value cck_value_wysiwyg_editor">
<p>Content</p>
</div>
</div>    
</div>

I added a file to the folder templates/seb_minima/fields/markup.php with content:

function cckMarkup_seb_minima( $cck, $html, $field, $options )
{
return $html;
}

Now I get this output:

<div id="cck13_mainbody" class="seb_css3 vertical cck13-deepest">
<p>Content</p>    
</div>

How can I get rid of that extra div? I only want to output the content.

The class seb_css3 gives me unwanted padding around my content.

I don't want to write extra css to override that padding. Better to get rid of the unnecessary div.


Any feedback on how to achieve this would be much appreciated. Thanky ou.

Get a VIP membership
84 Posts
Skepsis
11 years ago
1
Level 1

Hi gebeer,

if you want to have only labels and inputs then use the SD simple simon Template.

Greetings
Skepsis

11 years ago
0
Level 2

Hi Skepsis,


thank you for the suggestion.

I had been using SD simple simon template a lot with SEBLOD 2.x.

Now with V3 out, I thought, I'd give seb_minima a try.

Will try SD now again.


But in general it would be great to know the mechanisms that produce this div, so we can switch it off if desired in any template.

Cheers

gebeer

251 Posts
Viktor Iwan
11 years ago
2
Level 1

if you want to have a plain no css effect.. you should get rid off the

cck.css
cck.content
cck.intro
cck.item
cck.list
cck.search
cck.site

in the header

11 years ago
1
Level 2

Thank you, Viktor, for this information.

I totally agree.


But how do I get rid of them? I don't know which files in SEBLOD create them.


Would be great if you could share some ideas.

11 years ago
0
Level 3

After consulting google and some posts in the old seblod forum, I managed to get rid of all the styles in the head section.


In file /libraries/cck/rendering/rendering.php, I commented out two lines:

187	//$doc->addStyleSheet( JURI::root( true ).'/media/cck/css/cck.css' );
195	//$doc->addStyleSheet( JURI::root( true ).'/media/cck/css/cck.'.$this->client.'.css' );


In /templates/seb_blog/index.php, Icommented out line 132:

//$doc->addStyleSheet( JURI::root( true ).'/templates/'.$this->template.'/css/style.css' );


That was that.


Only thing I don't like that we have to do a core hck to achieve this.


It would be great if the developers could give us the possibility to deactivate all SEBLOD css from the general options.


What do you think?

11 years ago
0
Level 1

I added a feature request to the tracker:

Better control over css calls

251 Posts
Viktor Iwan
11 years ago
1
Level 1

Actually there's more better way to achieve this...

here's my chunk of code in my system plugin:

$headData=$doc->getHeadData();
         if(self::$useCSS=="0") unset($headData['styleSheets'][JURI::base(true).'/media/cck/css/cck.css']);
         if(self::$useCSS=="0") unset($headData['styleSheets'][JURI::base(true).'/media/cck/css/cck.content.css']);
        if(self::$useCSS=="0") unset($headData['styleSheets'][JURI::base(true).'/media/cck/css/cck.intro.css']);
        if(self::$useCSS=="0") unset($headData['styleSheets'][JURI::base(true).'/media/cck/css/cck.list.css']);
        if(self::$useCSS=="0") unset($headData['styleSheets'][JURI::base(true).'/media/cck/css/cck.search.css']);
         if(self::$useJS=="0") unset($headData['scripts'][JURI::base(true).'/media/cck/js/cck.core-3.0.0.min.js']);

$headData['style']['text/css'] = preg_replace('%/\* Variation: seb_css3 \*/\s*div.seb_css3 \{.*overflow:hidden; \}%', '', $headData['style']['text/css']);
       
$doc->setHeadData($headData);


...hope you can digest the code...


11 years ago
0
Level 2

Thank you for the code. I understand what it is supposed to do.


I removed the if statements and then inserted it into my tmeplate/index.php above

<jdoc:include type="head" />

and after

$doc = JFactory::getDocument();<br>


But still all the SEBLOD code in the head is there :-(


Is your plugin available through Products? I couldn't find it there.

251 Posts
Viktor Iwan
11 years ago
2
Level 1

have you remove   if(self::$useCSS=="0") and  if(self::$useJS=="0")

11 years ago
1
Level 2

yes, I removed those

11 years ago
0
Level 3

Now your code is partially working.


I had inserted it in my main template index.php, not in the seblod template index.php.

The calls to the css get inserted through SEBLOD. So I realised that I have to put it in the index.php of my seblod template.


I'm working on a list item template and almost everything gets removed by your code, except for:

<link rel="stylesheet" href="/media/cck/css/cck.item.css" type="text/css" />
<link rel="stylesheet" href="/media/cck/css/cck.css" type="text/css" />

 

I tried adding

unset($headData['styleSheets'][JURI::base(true).'/media/cck/css/cck.item.css']);

to your code.

But then all css calls are back in the head again :-(

It seems that the right sequence is important.


But thank you so far for your help.

11 years ago
0
Level 1

And I finally found, how I can get rid of the code that I mentioned in my first post above.

<div id="cck13_mainbody" class="seb_css3 vertical cck13-deepest">
</div>

This code is generated in /components/com_cck/views/list/tmpl/default.php

I added a simple joomla template override to mytemplate/html/com_cck/list/default.php where I removed the code for the divs that I don't need.

Now I have really clean code :-)

11 years ago
1
Level 1

How to remove Seblod extra-divs

Replace the whole content of seb_one/index.php with the following code :

<?php
/**
* @version 			SEBLOD 3.x Core ~ $Id: index.php alexandrelapoux $
* @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;

// -- Initialize
require_once dirname(__FILE__).'/config.php';
$cck	=	CCK_Rendering::getInstance( $this->template );
if ( $cck->initialize() === false ) { return; }
?>

<?php 
// -- Render
echo $cck->renderPosition( 'mainbody', '', $cck->h( 'mainbody' ) ); 
?>
                                	
<?php
// -- Finalize
$cck->finalize();
?>

Then override the 'article' content type :

<?php
defined('_JEXEC') or die ;

$full=$cck->getValue('art_fulltext');
$intro=$cck->getValue('art_introtext');
?>
 <?php echo $intro; ?>
 <?php echo $full; ?>

Only one Seblod div will remain in your custom contents and none in the standard article.


13 Posts
kpjuni
11 years ago
0
Level 2
Where do i override the 'article' content type?
11 years ago
1
Level 1

Thank you, hauger, for sharing.

This should also work for seb_blog, right?

1283 Posts
Bucklash
9 years ago
0
Level 2

+1

Nice work Geeber and others

Get a VIP membership