Feature Request: Add exhibit_builder_nested_nav() function like the one in Omeka 1.x versions

Open
#48 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
web-dev

Research direction

Start by locating the current exhibit section and page navigation entry points, then compare their behavior with the Omeka 1.x exhibit_builder_nested_nav() example in this issue. Determine how the current version represents exhibits, sections, and pages before deciding where the equivalent function belongs. Done means nested section navigation supports current-section handling and the showAllPages option without breaking existing navigation.

Written by the indexing model from the issue text.

Description

The code from the previous versions was this:

function exhibit_builder_nested_nav($exhibit = null, $showAllPages = false)
{
    if (!$exhibit) {
        if (!($exhibit = exhibit_builder_get_current_exhibit())) {
            return;
        }    
    }
    $html = '<ul class="exhibit-section-nav">';
    foreach ($exhibit->Sections as $exhibitSection) {
        $html .= '<li class="exhibit-nested-section' . (exhibit_builder_is_current_section($exhibitSection) ? ' current' : '') . '"><a class="exhibit-section-title" href="' . html_escape(exhibit_builder_exhibit_uri($exhibit, $exhibitSection)) . '">' . html_escape($exhibitSection->title) . '</a>';
        if ($showAllPages || exhibit_builder_is_current_section($exhibitSection)) {
            $html .= exhibit_builder_page_nav($exhibitSection);
        }
        $html .= '</li>';
    }
    $html .= '</ul>';
    $html = apply_filters('exhibit_builder_nested_nav', $html, $exhibit, $showAllPages);
    return $html;
}

It'd be great if there were something similar in the current version. If there are no plans to do this, I might write this function myself, although it'll take me quite a while to figure everything out.

Dominant language
PHP
Stars
25
Forks
37
Avg merge
5d 19h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from omeka/plugin-ExhibitBuilder

All issues in omeka/plugin-ExhibitBuilder

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.