0
Welcome Guest! Login
0 items Join Now

SOLVED Add new section to template

    • jayjayr's Avatar
    • jayjayr
    • Hero Rocketeer
    • Posts: 330
    • Thanks: 1

    SOLVED Add new section to template

    Posted 5 months 1 week ago
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 21595
    • Thanks: 3098
    • messin' with stuff

    Re: SOLVED Add new section to template

    Posted 5 months 1 week ago
    • Studius comes with 5 sections beneath the Main Container, each of which you can add multiple Rows to.

      Otherwise the doc you linked gives the basic breakdown of how layout.yaml files work... you don't need to create a new preset if you don't want to, you can just add additional sections to any given Outline's existing layout.yaml file. If you want to be able to style it from the Styles tab you have to create the additional blueprint files for the admin, but it's not required to just render a new section.

      Lower in that guide: docs.gantry.org/gantry5/advanced/creatin...isting-layout-preset
    • Last Edit: 5 months 1 week ago by Matt.
    • SEARCH the forum first! These boards are rich in knowledge and vast in topics. This includes searching just the 'Solved' forums, using Google, and using ChatGPT :woohoo:
    • jayjayr's Avatar
    • jayjayr
    • Hero Rocketeer
    • Posts: 330
    • Thanks: 1

    Re: SOLVED Add new section to template

    Posted 5 months 1 week ago
    • Hi Matt,

      I thank you for your answer but the solution is still a bit nebulous for me.
      According to your answer the topic I mentioned ( docs.gantry.org/gantry5/advanced/creatin...isting-layout-preset ) is the one.
      Ok, in that case I followed the 2nd approach, that seems to me that it would work like an override for when the there will be an update. So I followed this:
      "You can also add a section to an existing layout using a very similar process. You just need to copy the layout's YAML file from its original location and place it in your /custom directory. For example, you can copy THEME_DIR/layouts/default.yaml and place the copy in THEME_DIR/xxx/default.yaml directory and make your change(s) to the copy."

      The layout I want to change is home to add a new section below Main. I called it Below.
      I copied \templates\rt_studius\layouts\home_-_particles.yaml (is strange because is different from all the others but is the only home) to \templates\rt_studius\custom\ so I have now the file \templates\rt_studius\custom\home_-_particles.yaml
      I updated that file and add
      /below/:
      -
      - heading-8077
      -
      - 'stories-4677 50'
      - 'image-2414 50'

      below /container-main/ and before /expanded/

      Uploaded it and check templates.
      Layout home has not changed.

      Can you please point me where my error is or what is missing?

      Thank you
      Jay
    • Trying to learn something every day
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 21595
    • Thanks: 3098
    • messin' with stuff

    Re: SOLVED Add new section to template

    Posted 5 months 1 week ago
    • You need to nest it in the /layouts/ folder if you're trying to override or create a new layout -- /custom/layouts/home_-_particles.yaml -- if that doesn't work (TBH I wasn't aware you could override a Layout -- and it definitely won't automatically show up in an Outline you've already created; you'd need to use the Load button to reload the Preset) try copying it but renaming it "home 2" or something and see if it shows up in your Load Presets list.

      (personally, when I want to add a new Section for a given Outline I just edit the layout.yaml file that's in /custom/config/outline-name/ directly)

      Also, don't try and statically assign Particles to your new section... those numbers after heading, stores, image, etc are unique to specific particles and you should let Gantry write those IDs for you when you drag/drop in Particles. So just create a blank Section under layout:
        /below/:
          -

      and you also need to add your new section the structure: area beneath that

      docs.gantry.org/gantry5/advanced/creatin...ut-presets#structure
        below:
          type: section
          attributes:
            boxed: ''
            class: ''
            variations: ''

      Indentation matters in YAML, so make sure each line is indented properly
    • Last Edit: 5 months 1 week ago by Matt.
    • SEARCH the forum first! These boards are rich in knowledge and vast in topics. This includes searching just the 'Solved' forums, using Google, and using ChatGPT :woohoo:
    • jayjayr's Avatar
    • jayjayr
    • Hero Rocketeer
    • Posts: 330
    • Thanks: 1

    Re: SOLVED Add new section to template

    Posted 5 months 1 week ago
    • Thank you Matt.
      Meanwhile I checked for more information as the official Gantry is not very clear and I found one very simple and it is like the one you suggest:make the changes directly in /custom/config/outline-name/ (in this case outline-number).
      It worked perfectly and I understood the whole mechanics, including what you alert about the changes when adding particles.

      Thanks for your help.
      Jay
    • Trying to learn something every day

Time to create page: 0.037 seconds