modify category_items.php on template

More
12 years 3 months ago #27216 by blade3
ho yeah.. it's already.. sorry but it's for the category layout..
Code:
<?php if (isset($items[$i]->positions['above-description-line2-nolabel'])) : ?>

but not for the items layout.. i don't know if you want a printScreen to understand what I need :P

I don't think so that I explained correctly :P


I know that $items[$i]->position is the position inside the category layout but I need for Items layout.


thanks :-)

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #27218 by ggppdk
mmm, the title of this topic is about file category_items.php which creates the list of items in category view

For item view the file item.php is used, you can see inside it, and find various position
Code:
foreach ($this->item->positions['X'] as $field) : ... endforeach


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #27233 by blade3

ggppdk wrote: mmm, the title of this topic is about file category_items.php which creates the list of items in category view...


I know :-) I just want access to some custom field inside each item to create a custom "list item".

but I'm really inside category_items.php.
My template for the items is already created.

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #27237 by ggppdk
I see so you can use my previous answer:
Code:
<?php foreach ($items[$i]->positions['X'] as $field) : ?> <?php echo $field->label.' : '.$field->display; <?php endforeach; ?>

This will display field added in position X for item no $i


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29412 by bobthebob01
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.

Please Log in or Create an account to join the conversation.

More
12 years 1 month ago #29413 by ggppdk
variable $i does not exist, maybe change

<?php foreach ($items as $item) : ?>

to

<?php foreach ($items as $i => $item) : ?>


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.714 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline