Questions tagged [merge]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5
votes
2answers
20k views

Using Twig to merge an array and remove duplicates

Problem I'm building a .json file for a search component of a used cars website. The file needs to be built from the output of two sections within CraftCMS, Used Cars and Vans & Trucks. It ...
2
votes
1answer
2k views

Create an object of objects with merge

I'm trying to create an object of objects, can anyone suggest why object would only contain the last iteration of "itemObject"? {% set object = {} %} {% for entry in craft.entries.section("...
2
votes
2answers
382 views

Paginating Merged Element Queries

I really want something like this to work but the merge function turns Elements into Arrays. I've managed to work around it other times but what's the best practice to combine two entry sets and then ...
1
vote
1answer
116 views

Merge Entries but only after X amount of entries

I'm trying to get entries from two sections and merge them together which is pretty straight forward using the merge filter. For example, my sections are: News Promoted News But, my main issue is I ...
0
votes
0answers
45 views

Split categories by levels / List categories merged by name

I have a scenario where I need category levels (4 levels) split in different sections of the page, also some categories have the same name, I explain: I need to list entries based on a category group ...