8 years ago
Topic

Hi Guys and thanks again for your Seblod,

I've tryed to create a custom template to build a slider. In the past (Seblod 2.x) I've always used a pack made by someone I can't remember the name.  Now with the third version of Seblod, I've not idea why it is not working.

This is the code

<?php  // No Direct Access defined( '_JEXEC' ) or die; ?> <?php require_once dirname(__FILE__).'/config.php'; $cck=CCK_Rendering::getInstance(); if ( $cck->init() === false ) { return; } $doc =& JFactory::getDocument(); $doc->addStyleSheet(juri::base(TRUE)."/templates/".$this->template."/css/unslider.css"); $doc->addScript(juri::base(TRUE)."/templates/".$this->template."/js/unslider.js"); $doc->addScript(juri::base(TRUE)."/templates/".$this->template."/js/jquery.event.move.js"); $doc->addScript(juri::base(TRUE)."/templates/".$this->template."/js/jquery.event.swipe.js"); ?> <div> <ul> <?php $items = $cck->getItems(); foreach( $items as $item ) { $count++; ?> <?php /* IMPORTANT call your fields like $item->get('the_field')->value INSTEAD OF $cck->get('the_field')->value */ ?> <li> <div style="background-image: url('<?php echo $item->getThumb1('slide_img'); ?>');"> <div> <div> <h3><?php echo $item->get('slide_title'); ?></h3> <h2><?php echo $item->get('slide_subtitle'); ?></h2> <a href="/<?php echo $item->get('slide_link'); ?>"> <button>Scopri i dettagli!</button> </a> </div> </div> </div> </li> </ul> <div id="scroll-down"> </div> </div>

...

<?php $cck->finalize(); ?>

inserting this list in a module, to show it in the HOME ... makes the website completely white without any html. It seems like some PHP call, blocks everything. 

ops ... the system automatically compress it. So I think you will need to beautify it. 

Have someone any idea about how make it works again?

thx 

abram

Get a Book for SEBLOD
8 years ago
5
Level 1

I think the problem is in this lines of code in the first few lines:

require_once dirname(__FILE__).'/config.php'; 

$cck=CCK_Rendering::getInstance(); 

if ( $cck->init() === false ) { return; } $doc =& JFactory::getDocument();

1283 Posts
Bucklash
8 years ago
4
Level 2

Hi

Try this 

$cck=CCK_Rendering::getInstance( $this->template );
8 years ago
3
Level 3

Hi Bucklash and thanks for your help!

I've just tryed... but it doesn't works.

1283 Posts
Bucklash
8 years ago
2
Level 4

Hi

Same here... however I noticed this:

<h3><?php echo $item->get('slide_title');?></h3> 
<h2><?php echo $item->get('slide_subtitle');?></h2> 
<a href="/<?php echo $item->get('slide_link');?>"> 

...should be like this, and it causes me the WSOD

<h3><?php echo $item->getValue('slide_title');?></h3> 
<h2><?php echo $item->getValue('slide_subtitle');?></h2> 
<a href="/<?php echo $item->getValue('slide_link');?>"> 

Bucklash

8 years ago
1
Level 5

not yet

1283 Posts
Bucklash
8 years ago
0
Level 6

Hmm

you will still need to 'get' something?

so what are you 'getting'?

4229 Posts
Kadministrator
8 years ago
1
Level 1

First step in debugging code is to enable error reporting, this will enable you to see errors and not just blank page. Without this we are just guessing blindly.

8 years ago
0
Level 2

Hi Klas,

and thanks for your time! Unfortunately I used the debug mode of joomla... but nothing changed... the output is completely white, nothing else.

8 years ago
0
Level 1

Ok Guys I've found it! The problem is not in the index.php file, but in the confing.php.

This is what I've changed and now it finally works:

SEBLOD 2.x:        $user=CCK::getUser(); 

SEBLOD 3.x:        $user=JCck::getUser();

thanks to all for your help

Get a VIP membership