0
Welcome Guest! Login
0 items Join Now

SOLVED What is the correct way to store data for a particle?

  • SOLVED What is the correct way to store data for a particle?

    Posted 9 months 2 weeks ago
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 91245
    • Thanks: 11945
    • Web Designer/Developer

    Re: SOLVED What is the correct way to store data for a particle?

    Posted 9 months 2 weeks ago
    • As I said to you previously you should not be altering YAML files directly or programatically. Those files are extremely sensitive to formatting (e.g. indentations have meaning) and you are at high risk of breaking your site by attempting this. Particle data should only be amended via the particles settings on the layout of your outline (i.e. Gantry 5 is in control of writing the content to the YAML files and protecting their integrity).

      So, my advice is don't do it. But if you really want to proceed then I suggest that you discuss this with other likeminded developers in the Gantry 5 chatroom.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: SOLVED What is the correct way to store data for a particle?

    Posted 9 months 2 weeks ago
    • But I need a way of allowing users to add data without giving them Admin rights, or showing them how to edit templates (and the associated risk that someone will break the website by changing something else in the template). So, from what I understand from your reply, the particle is not really fit for purpose as calendar/diary module, and could be best described as a light "you might be interrested in" plugin. I'm guessing the way forward would be to rip out the flat file storage and go straight to a database- there would be less constraints that way.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 91245
    • Thanks: 11945
    • Web Designer/Developer

    Re: SOLVED What is the correct way to store data for a particle?

    Posted 9 months 2 weeks ago
    • 1. You can put the particle in a Gantry 5 module and give backend access to just that module for selected users.
      2. If you want to use a database then there are already many calendar modules avaiable on JED to do what you want so why reinvent the wheel. They will probably give your frontend edit ability as well as normal backend edit too.
      3. The thing that makes Gantry 5 and it's particles fast is the use of flat files - database will be slower.
      4. I don't recommend adding database access inside particles - to do that you would need to write you own PHP classes and load them into Gantry 5. http://docs.gantry.org/gantry5/advanced/php-functions .

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: SOLVED What is the correct way to store data for a particle?

    Posted 9 months 2 weeks ago
    • I think the thing is the template was sold to me on the fact that there was a calendar module built in, which meant that I didn't have to install yet another plugin (and it's dependencies) making the site larger and more unwieldly- and slowing it down because now there are half a dozen more resources to be loaded.

      Flat files might be fast while small- but you try doing an alphabetic search on an unstructured 10,000 line text file and tell me that a database is slower.
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 91245
    • Thanks: 11945
    • Web Designer/Developer

    Re: SOLVED What is the correct way to store data for a particle?

    Posted 9 months 2 weeks ago
    • Well I've given you my advice. Wow a 10,000 line calendar that's pretty impressive - good luck.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: SOLVED What is the correct way to store data for a particle?

    Posted 9 months 2 weeks ago
    • 10,000 lines would not be unusual for any decent level enterprise- for example, think of trying to keep track of a sports league.

Time to create page: 0.087 seconds