• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bancha, Open-source CMS

#32
[eluser]kkzhi[/eluser]
[quote author="Nicholas Valbusa" date="1335188282"]

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]

Oke this is it

Code:
<?php
/**
* Default website home template
*
* @package  Bancha
* @author  Nicholas Valbusa - [email protected] - @squallstar
* @copyright Copyright (c) 2011-2012, Squallstar
* @license  GNU/GPL (General Public License)
* @link  http://squallstar.it
*
*/

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

render('header'); ?>

<h1>This is the homepage of your website.</h1>

<p>This script is located here: <strong>themes/&lt;?php echo $this->view->theme; ?&gt;/views/templates/homepage.php</strong></p>
<p>Note that this is also a Record of type <strong>Menu</strong> marked as <strong>website homepage</strong> on the settings.</p>
&lt;?php $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
}
?&gt;
&lt;?php
if (type('Blog')) {

$posts = find('Blog')->limit(10)->order_by('date_publish', 'DESC')->get(); ?&gt;

<h2>Some posts</h2>

<ul>
&lt;?php
foreach ($posts as $post)
{
  ?&gt;<li><a href="&lt;?php echo semantic_url($post); ?&gt;">&lt;?php echo $post->get('title'); ?&gt;</a></li>
  &lt;?php
}
?&gt;
</ul>

&lt;?php
}

render('footer');

i made in a content types("teasers.xml") and i change field id text area to field id="teaser_image" recording to script that u give it to me
but seems like it didn't produce any $path in return.
and where i put a nivo slider pack that i download before? sorry for the question, i'm just newbie in this Sad


Messages In This Thread
Bancha, Open-source CMS - by El Forum - 01-08-2012, 10:36 AM
Bancha, Open-source CMS - by El Forum - 01-19-2012, 02:09 PM
Bancha, Open-source CMS - by El Forum - 01-19-2012, 04:49 PM
Bancha, Open-source CMS - by El Forum - 01-19-2012, 05:03 PM
Bancha, Open-source CMS - by El Forum - 01-22-2012, 07:17 AM
Bancha, Open-source CMS - by El Forum - 01-22-2012, 08:07 AM
Bancha, Open-source CMS - by El Forum - 01-23-2012, 06:24 PM
Bancha, Open-source CMS - by El Forum - 01-23-2012, 08:02 PM
Bancha, Open-source CMS - by El Forum - 01-24-2012, 04:04 AM
Bancha, Open-source CMS - by El Forum - 01-24-2012, 04:08 AM
Bancha, Open-source CMS - by El Forum - 01-24-2012, 04:31 AM
Bancha, Open-source CMS - by El Forum - 01-24-2012, 04:35 AM
Bancha, Open-source CMS - by El Forum - 01-27-2012, 08:47 AM
Bancha, Open-source CMS - by El Forum - 01-27-2012, 09:23 AM
Bancha, Open-source CMS - by El Forum - 01-28-2012, 07:52 AM
Bancha, Open-source CMS - by El Forum - 01-28-2012, 08:57 AM
Bancha, Open-source CMS - by El Forum - 01-28-2012, 10:29 AM
Bancha, Open-source CMS - by El Forum - 01-29-2012, 12:54 AM
Bancha, Open-source CMS - by El Forum - 01-30-2012, 09:16 AM
Bancha, Open-source CMS - by El Forum - 01-30-2012, 09:44 AM
Bancha, Open-source CMS - by El Forum - 01-30-2012, 09:51 AM
Bancha, Open-source CMS - by El Forum - 02-06-2012, 12:04 PM
Bancha, Open-source CMS - by El Forum - 03-19-2012, 02:12 AM
Bancha, Open-source CMS - by El Forum - 03-19-2012, 03:10 AM
Bancha, Open-source CMS - by El Forum - 04-17-2012, 02:11 AM
Bancha, Open-source CMS - by El Forum - 04-21-2012, 02:50 AM
Bancha, Open-source CMS - by El Forum - 04-21-2012, 09:55 AM
Bancha, Open-source CMS - by El Forum - 04-23-2012, 02:38 AM
Bancha, Open-source CMS - by El Forum - 04-23-2012, 03:45 AM
Bancha, Open-source CMS - by El Forum - 04-23-2012, 06:12 AM
Bancha, Open-source CMS - by El Forum - 04-23-2012, 06:38 AM
Bancha, Open-source CMS - by El Forum - 04-23-2012, 07:21 AM
Bancha, Open-source CMS - by El Forum - 04-23-2012, 07:43 AM
Bancha, Open-source CMS - by El Forum - 04-23-2012, 08:23 AM
Bancha, Open-source CMS - by El Forum - 04-23-2012, 08:43 AM
Bancha, Open-source CMS - by El Forum - 04-23-2012, 09:18 AM
Bancha, Open-source CMS - by El Forum - 04-23-2012, 09:43 AM
Bancha, Open-source CMS - by El Forum - 04-23-2012, 09:56 AM
Bancha, Open-source CMS - by El Forum - 04-26-2012, 10:23 PM
Bancha, Open-source CMS - by El Forum - 05-07-2012, 04:00 AM
Bancha, Open-source CMS - by El Forum - 05-08-2012, 06:13 AM
Bancha, Open-source CMS - by El Forum - 05-14-2012, 06:06 PM
Bancha, Open-source CMS - by El Forum - 05-17-2012, 08:03 AM
Bancha, Open-source CMS - by El Forum - 07-07-2012, 01:15 PM
Bancha, Open-source CMS - by El Forum - 08-16-2012, 05:00 AM
Bancha, Open-source CMS - by El Forum - 06-02-2014, 11:00 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.