[SOLVED] Templating : modify $this->items

More
11 years 1 month ago - 10 years 6 months ago #52906 by juansolos
Hello,
i have a category view with articles.

I want articles displayed have a different value for the fieldX.

So in my categoryitem.php, i transform "$this->items" in a new $this->items.
That work as expected.

But of course my filter total results are not correct.

So my question is :
Where can i transform my $this->items array on the top of files?

In this way, the new $this->items array will be use by all files.

I hope i am clear.

Regards
Last edit: 10 years 6 months ago by ggppdk.

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

More
11 years 1 month ago #52926 by ggppdk
Hello

inside the template, you are examining
$this->items

so that you exclude / skip some of them,


-- no you cannot alter the filters these are based on the SQL query that created the original
$this->items


-- 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
11 years 1 month ago #52933 by juansolos
Thanks for the reply.
Yes i suppose that the filter use the sql query.

So the better way is to change the query;)

I imagine there is no way to override the query?

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

More
11 years 1 month ago #52957 by ggppdk
Hello

no, we would not allow it, since this would limit our changes in future versions


-- 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
11 years 1 month ago #52959 by juansolos
Ok.
So i think i should modifiy the query and add a "distinct fieldX" somewhere.

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

More
11 years 1 month ago #52978 by ggppdk
Hello

add query for a field ?


you can filter a category view

- via visible filters
- but you can also do via a category menu item,
1. enable parameter override
2. set a "locked" filter value in the filtering section (at the bottom of the TAB) (note the field must be TAGGED as 'filter' for this to work)
- the locked value can be single value, multiple or range

-- you can create a menu that comprises of menu items with locked filter values to achieve a "partitioning" of a category


-- 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
11 years 1 month ago #52982 by juansolos
Not a query for a field.

As explain, in this post
<!-- l --><a class="postlink-local" href=" www.flexicontent.org/phpbb/viewtopic.php?f=9&t=8824&start=10 ">viewtopic.php?f=9&t=8824&start=10

I try to find owner depending filtering their product.
The group field is fine to creat products in the owner's item but group field is not filtering.

So my solution is to creat 2 items types. Product and owner. And a field relation.

So i filter on product page and display only the relation field, it is fine i get owner infos.
But of course if several products from the same owner appear. I get several time the same owner on the page.

I can change this, with modification on the "$this->items" in the category view (don't display the item if i have an item with the same relation field value)
But the next problem is to have results ad pagination depending my new "$this->items".

It should be better to add directly somethng on the main sql query.

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

More
11 years 1 month ago #52984 by ggppdk
Hello

-- a field participating in a group can be displayed as a filter,

what is the implicit relation about fields in group field that you mean, in regards to filtering ?


-- 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
11 years 1 month ago #52985 by juansolos
Yes i would like to combine filter.

Field group with a field size and a field color

If i set 2 filters : big for size and blue for color.

I get all results with this value but not for the same group.

Example :
item 1
Field group : big - white

item 2
Field group : small - blue

Filtering on big- blue give me item 2 et item 1.

group field is not filtering.
Do you anderstand what i explain?

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

More
11 years 1 month ago #52990 by ggppdk
Hello

e.g. when you filter you get items
- with color: red
- with size: 10

-- you will get items that have this color and this size inside the same field group !
(provide you are only using field inside a group)

since all filters are "required" filters do a logical AND and not a logical OR

-- and you should not use fields in fieldgroup only inside the group, e.g. don't use them outside the group in some other item types


-- 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