Skip to content
wiki.fftac.org

Library - Source Excerpt 05

Back to Library

Summary

This source excerpt preserves a bounded section of Spiralist/wp-content/plugins/spiralist-workspace/templates/library.php so readers can inspect the evidence without opening the full source file.

**Source path:** Spiralist/wp-content/plugins/spiralist-workspace/templates/library.php

<?php if (!empty($featured_collections) || !empty($api_examples)) : ?>
        <section class="spiralist-page-section">
            <div class="spiralist-shell spiralist-grid spiralist-grid--split">
                <?php if (!empty($featured_collections)) : ?>
                    <article class="spiralist-panel">
                        <p class="spiralist-section-tag">Featured Collections</p>
                        <h2 class="spiralist-section-title">Curated ways into the library.</h2>
                        <div class="spiralist-simple-list">
                            <?php foreach ($featured_collections as $collection) : ?>
                                <div class="spiralist-simple-list__item">
                                    <strong><?php echo esc_html((string) ($collection['title'] ?? 'Collection')); ?></strong>
                                    <p class="spiralist-muted"><?php echo esc_html((string) ($collection['summary'] ?? '')); ?></p>
                                    <span class="spiralist-simple-list__meta"><?php echo esc_html((string) ((int) ($collection['count'] ?? 0))); ?> prompts</span>
                                    <?php if (!empty($collection['records'])) : ?>
                                        <div class="spiralist-chip-row spiralist-chip-row--dense">
                                            <?php foreach ((array) ($collection['records'] ?? []) as $prompt) : ?>
                                                <a class="spiralist-chip" href="<?php echo esc_url($route_url('prompt/' . rawurlencode((string) ($prompt['slug'] ?? '')))); ?>" data-engagement-event="prompt_dossier_open" data-engagement-surface="prompt-library" data-engagement-target="<?php echo esc_attr($engagement_target((string) ($prompt['slug'] ?? $prompt['title'] ?? 'prompt'), 'prompt')); ?>"><?php echo esc_html((string) ($prompt['title'] ?? 'Prompt')); ?></a>
                                            <?php endforeach; ?>
                                        </div>
                                    <?php endif; ?>
                                    <?php if (!empty($collection['query']) && is_array($collection['query'])) : ?>
                                        <a class="spiralist-button spiralist-button--tertiary" href="<?php echo esc_url($filter_route_url((array) $collection['query'])); ?>" data-engagement-event="intent_card_click" data-engagement-surface="prompt-library" data-engagement-target="<?php echo esc_attr($engagement_target((string) ($collection['title'] ?? 'collection'), 'collection')); ?>">Open Collection</a>
                                    <?php endif; ?>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    </article>
                <?php endif; ?>

                <?php if (!empty($api_examples)) : ?>
                    <article class="spiralist-panel">
                        <p class="spiralist-section-tag">API Examples</p>
                        <h2 class="spiralist-section-title">Machine-readable export kits.</h2>
                        <div class="spiralist-simple-list">
                            <?php foreach ($api_examples as $example) : ?>
                                <div class="spiralist-simple-list__item">
                                    <strong><?php echo esc_html((string) ($example['label'] ?? 'API example')); ?></strong>
                                    <p class="spiralist-muted"><?php echo esc_html((string) ($example['summary'] ?? '')); ?></p>
                                    <a class="spiralist-button spiralist-button--tertiary" href="<?php echo esc_url((string) ($example['url'] ?? $api_url)); ?>" data-engagement-event="advanced_layer_open" data-engagement-surface="prompt-library" data-engagement-target="<?php echo esc_attr($engagement_target((string) ($example['label'] ?? 'api-example'), 'api-example')); ?>"><?php echo esc_html((string) ($example['url'] ?? $api_url)); ?></a>
                                </div>
                            <?php endforeach; ?>
                        </div>
                    </article>
                <?php endif; ?>
            </div>
        </section>
    <?php endif; ?>
                </div>
            </details>
        </div>
    </section>

    <section class="spiralist-page-section spiralist-page-section--full-library">
        <div class="spiralist-shell">
            <details class="spiralist-prompt-full-library" <?php echo $filters_active ? 'open' : ''; ?> data-engagement-details="full_library_open" data-engagement-surface="prompt-library" data-engagement-target="full-library-lanes">
                <summary>
                    <span>Open full prompt library lanes</span>
                    <small>Official canon, community library, and prompt ecology archive records.</small>
                </summary>
                <div class="spiralist-prompt-full-library__body">
    <section class="spiralist-page-section spiralist-page-section--nested" id="official-canon">
        <div class="spiralist-shell">
            <div class="spiralist-section-head">
                <div>
                    <p class="spiralist-section-tag">Official Canon</p>
                    <h2 class="spiralist-section-title">Grounded prompt systems for daily work.</h2>
                    <p class="spiralist-muted">These prompts define the public starting point for Spiralism on Spiralist.org.</p>
                </div>
            </div>
            <?php if (!empty($sections['official_canon'])) : ?>
                <?php $render_prompt_cards((array) $sections['official_canon']); ?>
            <?php else : ?>
                <article class="spiralist-panel">
                    <p class="spiralist-muted">No official-canon prompts match the current filters.</p>
                </article>
            <?php endif; ?>
        </div>
    </section>

    <section class="spiralist-page-section" id="community-library">
        <div class="spiralist-shell">
            <div class="spiralist-section-head">
                <div>
                    <p class="spiralist-section-tag">Community Library</p>
                    <h2 class="spiralist-section-title">Versioned community prompt manuscripts.</h2>
                    <p class="spiralist-muted">Forkable prompt records, moderation-aware publication, and ongoing refinement through tests and revisions.</p>
                </div>
            </div>
            <?php if (!empty($sections['community_library'])) : ?>
                <?php $render_prompt_cards((array) $sections['community_library']); ?>
            <?php else : ?>
                <article class="spiralist-panel">
                    <p class="spiralist-muted">No community-library prompts match the current filters.</p>
                </article>
            <?php endif; ?>
        </div>
    </section>

    <section class="spiralist-page-section" id="prompt-ecology-archive">
        <div class="spiralist-shell">
            <div class="spiralist-section-head">
                <div>
                    <p class="spiralist-section-tag">Prompt Ecology Archive</p>
                    <h2 class="spiralist-section-title">Historical records, critical analysis, and safe rewrites.</h2>
                    <p class="spiralist-muted">This lane preserves public symbolic prompt forms while making risk, provenance, and editorial context visible.</p>
                </div>
            </div>
            <?php if (!empty($sections['prompt_ecology_archive'])) : ?>
                <?php $render_prompt_cards((array) $sections['prompt_ecology_archive']); ?>
            <?php else : ?>
                <article class="spiralist-panel">
                    <p class="spiralist-muted">No archive prompts match the current filters.</p>
                </article>
            <?php endif; ?>
        </div>
    </section>
                </div>
            </details>
        </div>
    </section>
</main>
<?php
get_footer();