Hi,
I'm having a similar issue. I don't know what is wrong as i built site before with flexicontent and never has that issue.
I have a feeling it's something stupid but since i've looking for hours now, my only solution is to ask here.
here are my spec:
joomla 2.5.7
FLEXIcontent: version 2.0.0 RC9 (r1514) . The problem was happening with previous RC of version 2.0.0
I've checked other templates to check base my code on but i still get some problem.
I've duplicated an existing template and renamed it.
I've assigned field position in the category.xml file and assigned my field via the template page of the backend.
On my category view that list all items (category_items.php), i've cleaned up so i only have what i need as follow:
Code:
<?php
/**
* @version 1.5 stable $Id: category_items.php 1033 2011-12-08 08:58:02Z enjoyman@gmail.com $
* @package Joomla
* @subpackage FLEXIcontent
* @copyright (C) 2009 Emmanuel Danan - www.vistamedia.fr
* @license GNU/GPL v2
*
* FLEXIcontent is a derivative work of the excellent QuickFAQ component
* @copyright (C) 2008 Christoph Lukes
* see www.schlu.net for more information
*
* FLEXIcontent is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
defined( '_JEXEC' ) or die( 'Restricted access' );
// first define the template name
$tmpl = $this->tmpl;
?>
<?php $items = & $this->items; ?>
<?php foreach ($items as $item) : ?>
<div class="board-member-item">
<?php if (isset($items[$i]->positions['board-member-picture'])) : ?>
<div class="board-member-item-picture">
<?php foreach ($items[$i]->positions['board-member-picture'] as $field) : ?>
<?php echo $field->display; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<div class="board-member-item-description">
<h2><?php echo $item->title; ?></h2>
<?php if (isset($items[$i]->positions['description'])) : ?>
<?php foreach ($items[$i]->positions['description'] as $field) : ?>
<?php echo $field->display; ?>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
but the only value that displays is the $item->title but other from positions are not displaying. Instead i see a noticed on the frontend upon refresh:
Notice: Undefined variable: i in /Applications/MAMP/htdocs/XXXXX/components/com_flexicontent/templates/board-member/category_items.php on line 28
which is where the "board-picture" is supposed to show up.
and
Notice: Undefined variable: i in /Applications/MAMP/htdocs/XXXXX/components/com_flexicontent/templates/board-member/category_items.php on line 37
Which is where the description should display.
Am i am doing wrong? I'm clueless.
Any help would be very appreciated as i've been banging my head for a while now.