Pinegrow Community Support Forum

Every new snippet makes de snippet plugin/library unavailable and/or destroys it

So here’s the thing: I created a PG project called CanvasSnippets. Canvas is a multi page template and I’m making my own collection of snippets.

So, when I open one template page to save a snippet out of it, I go to Page -> Manage Libraries & Plugins (I’ve also tried using File -> Manage Libraries & Plugins), I load and activate my CanvasSnippets.js and my blocks load in the components panel.

I add a few snippets, rename them… and open the next template page. Now, those snippets are gone. I check with Page -> Manage Libraries & Plugins, it’s listed there but not active. So I go to activate it and I get something like “This thing is already activate it, you have to disable it first”.
Then, I go to File -> Manage Libraries & Plugins and it’s there activated! But still disappeared from the components panel. So I deactivate and activate again. No errors but still not showing there.

I close the whole project and start again. Now it works. I do a couple snippets and again with the same issue :rage:

Worst of all, this time, I go to check on that *.js where the snippets are and they are all gone. There’s only this skeleton:

$(function() {

    //Wait for Pinegrow to wake-up
    $("body").one("pinegrow-ready", function(e, pinegrow) {

        //Create new Pinegrow framework object
        var f = new PgFramework("CanvasSnippets", "CanvasSnippets");

        //This will prevent activating multiple versions of this framework being loaded
        f.type = "CanvasSnippets";
        f.allow_single_type = true;
        f.user_lib = true

        //Tell Pinegrow about the framework
        pinegrow.addFramework(f);
            
        var section = new PgFrameworkLibSection("CanvasSnippets_lib", "Components");
        //Pass components in array
        section.setComponentTypes([]);

        f.addLibSection(section);
   });
});

Here’s when I realize I can’t trust PG with any file, so thank god I had GIT working from the get go.

So, 1) the library disappearing every time I open a new page is so frustrating, am I at fault here?. 2) PG will just eat hours of snippetting for no apparent reason.

Help?

Hi @cifra, sorry to hear about that. We’re investigating the issue. So far I was not able to replicate it. Does it happen every time you do those steps?

Giving I was confused between components, resources, and libraries (and have the option of loading a project as a library or as a plugin), I salvaged the last good version of the snippets *.js file from git and started the everything else from scratch.

There are still some inconsistencies. For example, the first time I start creating snippets, it says “Snippets” on the components bar, which makes sense. But later on, I load it as a plugin to keep adding bits of HTML; then it shows as “Components.”

Now it works almost like expected. I think I opened a different thread for the issue of hovering over the snippet and seeing a rendered image that’s just HTML. So it looks all ugly and without layout.

I am looking forward to a better PG with better docs.

Thank you