modify category_items.php on template

More
13 years 6 months ago #27148 by blade3
I create a new template (duplicate blog template) And i would like to access inside category_items.php to
item positions and field inside the position..
I know to access item position inside item.php is like:
Code:
<?php if (isset($item->positions['title'])) : ?> <?php foreach ($this->item->positions['title'] as $field) : ?>

and inside the category_items we use:
Code:
$items[$i]->title

to get title.. but not all field inside the title position..


Any idea ?

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

More
13 years 6 months ago #27152 by ggppdk
Inside the 'title' position are only the fields that you have added in title position of the category layout of the 'blog' template.

Goto template manager and check which fields you have added in the title position


-- 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 review. Thanks!

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

More
13 years 6 months ago #27180 by blade3
thanks to reply :-)

When I duplicate my blog template.. I've changed some position and now the title position is not only for the title..

On the category layout, I've no field inside.. and I've create items layout with few custom field but in the category_items.. i want the same items layout.

With all items but the max length "description" 200...

when we list all items using leadblock and introblock...

I just want to extract all field for "X" position like we can do inside the items.php

thanks :-)

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

More
13 years 6 months ago #27200 by ggppdk
This gives you the fields of position 'X' for item no $i

$items[$i]->positions;

Or you need the field names entered in position 'X'?


-- 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 review. Thanks!

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

More
13 years 6 months ago #27201 by blade3

ggppdk wrote: This gives you the fields of position 'X' for item no $i

$items[$i]->positions;

Or you need the field names entered in position 'X'?


if I understand,
I can:
Code:
<?php if (isset($items[$i]->positions['x'])) : ?> <?php foreach ($items[$i]->positions['x'] as $field) : ?>

??

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

More
13 years 6 months ago #27204 by ggppdk
mmm, yes the code is already present inside the template file


-- 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 review. Thanks!

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

More
13 years 6 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
13 years 6 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 review. Thanks!

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

More
13 years 6 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
13 years 6 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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
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
Save