0
Welcome Guest! Login
0 items Join Now

Using joomla.finder

    • shenk's Avatar
    • shenk
    • Hero Rocketeer
    • Posts: 412
    • Thanks: 11

    Using joomla.finder

    Posted 8 months 1 week ago
    • I find the documentation regarding Joomla.finder is a little too brief.

      I wanna combine two finders together, is it possible?

      The actual use case is:
      I want to display 5 articles on homepage. In these 5 articles, the first 2 are fixed, I "find" them by providing the article IDs, the other 3 are the latest articles from certain categories, if the either of the fixed two articles happen to be the one of the latest, it should be skipped.

      Having read the documentation, I couldn't find a way to achieve this.
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 20628
    • Thanks: 2924
    • messin' with stuff

    Re: Using joomla.finder

    Posted 8 months 1 week ago
    • It's pretty thoroughly documented.

      docs.gantry.org/gantry5/advanced/content-in-particles

      you'll need to work through your own queries and build your own variables that piece everything together. Sure, you can create multiple finders...

      {% set finder1 = joomla.finder('content', options) %}
      {% set finder2 = joomla.finder('content', options) %}

      then you can merge them into a single array

      twig.symfony.com/doc/1.x/filters/merge.html

      and loop (foreach) over them and do whatever you want.

      I'd recommend inspecting the contentarray.html.twig for the Content Array Particle...

      ROOT/media/gantry5/engines/nucleus/particles/

      that'll show you how that Particle makes its various queries.
    • SEARCH the forum first! These boards are rich in knowledge and vast in topics :woohoo:
    • shenk's Avatar
    • shenk
    • Hero Rocketeer
    • Posts: 412
    • Thanks: 11

    Re: Using joomla.finder

    Posted 8 months 6 days ago
    • Thanks.
      Why not add "how to merge" to this documentation page then people would not have to look for the twig doc?
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 20628
    • Thanks: 2924
    • messin' with stuff

    Re: Using joomla.finder

    Posted 8 months 5 days ago
    • Symfony owns TWIG and they thoroughly document it.
    • SEARCH the forum first! These boards are rich in knowledge and vast in topics :woohoo:

Time to create page: 0.059 seconds