Skip to content

Expand/Collapse all blocks when editing a page, post or content #1570

Answered by tidyui
horacioj asked this question in Ideas
Discussion options

You must be logged in to vote

Hi there! You could add to your project by creating a file named _PageExpandCollapse.cshtml in the folder ~/Areas/Manager/Pages/Partial/Actions/ in your application. The add the following markup to the file:

<button class="btn btn-primary btn-icon" onclick="expandCollapse(this, false)">
    <i class="fas fa-chevron-down"></i>
</button>
<button class="btn btn-primary btn-icon" onclick="expandCollapse(this, true)">
    <i class="fas fa-chevron-up"></i>
</button>
<script>
    function expandCollapse (btn, collapsed) {
        for(var n = 0; n < piranha.pageedit.blocks.length; n++) {
            piranha.pageedit.blocks[n].meta.isCollapsed = collapsed;
        }
        btn.blur();
    }
</scr…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@horacioj
Comment options

Answer selected by horacioj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants