Question

Photo of Herb Parsons

0

"This Site is assigned to a block"

I'm trying to delete a site and start from scratch because some of the odd behavior I'm seeing (and because I've learned a little more). However, I cannot delete the site. When I try, I get an Alert message that says "This Site is assigned to a block". I've looked at the blocks, and can't see how to find which one is assigned to the site. I don't remember doing this either, but I've poked around enough the past few weeks that it's possible. 


Any clues on how I can find the block that's assigned?

  • Photo of David Axelson

    0

    I would try something like this:

    {% block where:'SiteId == 13' securityenabled:'false' %}
        {% for block in blockItems %}
            {{ block.Name }} ({{ block.BlockType.Name }}) <a href="/page/{{ block.PageId }}">{{ block.Page.PageTitle }}</a><br>
        {% endfor %}
    {% endblock %}

    Update the Site Id and it should list out the blocks with this Site Id attached (with a link to the page).

  • Photo of Herb Parsons

    0

    I'm a little lost - where do I apply this?

    • David Axelson

      This would be a good use for the Lava Tester plugin, though you could put it in any html block to get the results.

  • Photo of Herb Parsons

    0

    Now I'm even more confused. I tried adding it to a blank page as an HTML block, but it generates the message "The Lava command 'rockentity' is not configured for this template." I tried it with several different templates, and got the same response.

    I don't mind adding a Lava tester, but the only one I see is the one from Central Christian Church in Arizona. The description says "... letting you quickly test your Lava against your real-world Person, Group or Workflow data." Is that going to work for this?

    • Herb Parsons

      Please disregard. I found the setting (while following directions for the Compass theme). I needed to check "Rock Entity" on the Block Properties setting. That showed me the stuff assigned, so I'm off to see if that fixes it.

  • Photo of Herb Parsons

    0

    That code did the trick (after I got it to run, and after a bunch of trial and error). Once I got it running, I had to create a default page for it by copying my current live page (apparently trying to delete it, on each of my several tries, deleted the default page, but not the site). When I created the default page, the three offending blocks showed up site wide. I deleted them from the page, saved the page, and then tried to delete the site. I got the same error.

    I recreated another default page, again from my site, and this time instead of deleting the offending blocks, I moved them to the page instead of the site. I was then able to delete the site.

    But then, I looked at my home page, and the three blocks were gone!! Fortunately, I have a dev site set up where I create things first, so I was able to copy the block content from there to the live site.

    Thank you for your help!!