04-23-2012, 06:38 AM
[eluser]Nicholas Valbusa[/eluser]
[quote author="kkzhi" date="1335186742"][quote author="Nicholas Valbusa" date="1335177922"]
Hello,
I used NivoSlider, it's really easy to use: http://nivo.dev7studios.com/
To extract the contents, just create a content type with an images field and extract it on the homepage view as follows:
Nicholas[/quote]
Hello Nicholas, thx for the explanation, but its seems like i missunderstood or just dont get it cause it give a warning message like this
can u tell me why? thanks
[/quote]
Hello, you're likely trying to get a property on a string/array.
Could you please send me your homepage.php template so I can help you?
Nicholas
[quote author="kkzhi" date="1335186742"][quote author="Nicholas Valbusa" date="1335177922"]
Hello,
I used NivoSlider, it's really easy to use: http://nivo.dev7studios.com/
To extract the contents, just create a content type with an images field and extract it on the homepage view as follows:
Code:
$teasers = find('Teasers')->limit(10)->order_by('date_update', 'DESC')->get();
foreach ($teasers as $teaser) {
$imgs = $teaser->get('teaser_image'); //images field
$path = $imgs[0]->path; //the first image
echo '<img src="' . $path . '" />'; //prints the image
}
Nicholas[/quote]
Hello Nicholas, thx for the explanation, but its seems like i missunderstood or just dont get it cause it give a warning message like this
Code:
A PHP Error was encountered
Severity: Notice
Message: Uninitialized string offset: 0
Filename: templates/homepage.php
Line Number: 25
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: templates/homepage.php
Line Number: 25
can u tell me why? thanks

Hello, you're likely trying to get a property on a string/array.
Could you please send me your homepage.php template so I can help you?
Nicholas