0
Welcome Guest! Login
0 items Join Now

Page Content Particle

    • CCDW's Avatar
    • CCDW
    • Rocketeer
    • Posts: 62
    • Thanks: 0

    Page Content Particle

    Posted 8 years 6 months ago
    • Hi

      I have read the Gantry 5 documentation and couldn't see an overall description of what files are called and when.

      I can see how to make particles etc and have created my own custom post type twig templates, but if for example I include the Page Content Particle and ENABLE it, where is that enabled flag read? Which php/Timber file reads that enabled flag?

      Thanks,

      Chris
  • Re: Page Content Particle

    Posted 8 years 5 months ago
    • The Enabled flag is tied directly to the core of Gantry. While Gantry does it's frontend processing and rendering and examines all the particles that should be rendered in the page that's been requested, the enabled flag gets red and if disable will skip it.

      You won't commonly find any reference to particle.enabled in a Particle twig, as it happens at a lower level in the core of the framework.

      Hope this answers the question.
    • / Djamil Legato / Lead Developer /
    • CCDW's Avatar
    • CCDW
    • Rocketeer
    • Posts: 62
    • Thanks: 0

    Re: Page Content Particle

    Posted 8 years 5 months ago
    • Thanks but not really. What I really need to know is:

      If I set enabled to true for the Page Particle, in a layout where in the framework does it decide to call or not call the page rendering templates?

      Reason being is I'd like to send other info from the Page particle such as which sub template to display. E.G. I've added a new field in the particle called mode, and I want to use that field in my templates... As simple request really.

      :)
    • Matias Griese's Avatar
    • Matias Griese
    • Sr. Rocketeer
    • Posts: 249
    • Thanks: 104
    • Lead Developer

    Re: Page Content Particle

    Posted 8 years 5 months ago
    • Actually enabled state of the particle is checked in a twig file called engines/nucleus/templates/content/particle.html.twig, which will allow you override enabled logic -- just follow the override instructions. If particle is disabled, the twig file will return nothing causing particle to get dropped off.

      You can easily send extra information to the twig file (either add it into particle, context or make a function call).

      PS. the same works inside the particle itself: if you return no output, particle will not be shown.
    • Last Edit: 8 years 5 months ago by Matias Griese.
    • Gantry 5, enjoy!
    • CCDW's Avatar
    • CCDW
    • Rocketeer
    • Posts: 62
    • Thanks: 0

    Re: Page Content Particle

    Posted 8 years 5 months ago
    • Thank you!

      I'll take a look.

      This platform has the potential to lead the WP sector - but it needs more documentation.

      : )

      chris
    • CCDW's Avatar
    • CCDW
    • Rocketeer
    • Posts: 62
    • Thanks: 0

    Re: Page Content Particle

    Posted 8 years 5 months ago
    • Thanks, I took a look, but I think I'd rather work within the theme twig templates.

      Can you tell me the gantry function call to retrieve the class or attribute values that are set in the Page Content Particle?

      If you could help with the above, it would be most useful.

      chris
    • CCDW's Avatar
    • CCDW
    • Rocketeer
    • Posts: 62
    • Thanks: 0

    Re: Page Content Particle

    Posted 8 years 5 months ago
    • Guys, sorry to push on this, I am trying to develop with your platform with very little documentation....

      Re my previous request above I am condensing the problem down into one single request.

      I am working in:

      content-page.html.twig

      From within this file how do I retrieve the assigned CSS class for the current particle? Not the default class but the class I assign to the particle in the layout editor.

      I'd appreciate help with this as I am assuming it's a simple answer.

      Thanks

      Chris
    • Damir's Avatar
    • Damir
    • Preeminent Rocketeer
    • Posts: 22450
    • Thanks: 2679
    • Web Developer

    Re: Page Content Particle

    Posted 8 years 1 month ago

Time to create page: 0.063 seconds