Skip to content

feat: CMD-187 autocreate search page - #885

Closed
wesleyboar wants to merge 67 commits into
mainfrom
feat/template-and-setting-for-google-search
Closed

feat: CMD-187 autocreate search page#885
wesleyboar wants to merge 67 commits into
mainfrom
feat/template-and-setting-for-google-search

Conversation

@wesleyboar

@wesleyboar wesleyboar commented Oct 22, 2024

Copy link
Copy Markdown
Member

Note

For latest attempt, see #1216.

Overview

Support a Google Search page with less effort.

What Effort?

Every Time:

  1. Create search engine.
  2. Configure search engine to match others.
  3. Set owners of search engine.
  4. Copy search codeID.
  5. Set relevant SEARCH settings.

Previously:

  1. Restart the server.
  2. Create /search page.
  3. Create snippet on page.
  4. Paste search code in snippet.
  5. Duplicate-or-Neglect search styles from TACC

Now, Instead:

  1. Restart the server.

Caution

Do not merge.

Warning

Successful run requires two deploys. Help wanted.

Related

Instances:

Changes

  • added search_page app
  • added SEARCH_AUTO_SETUP setting
  • added GOOGLE_SEARCH_ENGINE_ID setting

Testing

  1. Register a Google Programmable Search Engine.
  2. Add real GOOGLE_SEARCH_ENGINE_ID setting e.g.
    GOOGLE_SEARCH_ENGINE_ID = 'b099996c09ebd4ece'
  3. Add SEARCH_AUTO_SETUP = True setting.
  4. Run/Deploy website that has no search page.
  5. Verify "Search (Auto-Generated)" page exists.
  6. Search using search bar.
  7. ✅ Verify search page shows with results.
  8. Remove GOOGLE_SEARCH_ENGINE_ID setting.
  9. Run/Deploy site.
  10. Revisit search page.
  11. ✅ Verify warning appears on page.

UI

with GOOGLE_SEARCH_ENGINE_ID sans GOOGLE_SEARCH_ENGINE_ID
search is set search not set

So that it can be loaded from CDN. Use cases are:
- if search template is broken
- for custom search page
- for non-Core website
Compared to "cms-search", "google-search" is:
- more accurate
- more obvious to those not familiar with Core-CMS
So dev sees 'google-search' from CSS before seeing it in HTML `id` attr.
@wesleyboar
wesleyboar marked this pull request as ready for review October 22, 2024 23:37
@wesleyboar wesleyboar changed the title feat: template & setting for Google search feat: search_page app Oct 24, 2024
@wesleyboar

Copy link
Copy Markdown
Member Author

Reviewers removed for now.

wesleyboar added a commit to TACC/CTRN-CMS that referenced this pull request Jan 27, 2026
CTRN had used (unmerged) TACC/Core-CMS#885.

That means it has remnant code of a search_page app.
@wesleyboar
wesleyboar changed the base branch from release/v4.36.X to main January 30, 2026 23:53
Added styles to fix link UI and UX.
Added styles to fix MORE link UI and UX.
@wesleyboar
wesleyboar force-pushed the feat/template-and-setting-for-google-search branch from 75768fe to 846e35e Compare February 23, 2026 19:04
@wesleyboar

wesleyboar commented Mar 24, 2026

Copy link
Copy Markdown
Member Author

Important

Replaced by #1129.

@wesleyboar wesleyboar closed this Mar 24, 2026
wesleyboar added a commit that referenced this pull request Jul 27, 2026
## Overview

Rebuilds the search feature on current `main` instead of stale
`release/v4.36.X`.

> [!WARNING]
> First run on a fresh database will crash `manage.py migrate` itself,
because `apps/search_page/apps.py`'s `ready()` hook queries `cms_page`
before it exists. Workaround: set `SEARCH_PAGE_AUTO_SETUP = False`,
migrate, then set it back to `True` and restart.
[Details.](#885 (review))

> [!IMPORTANT]
> Should instead:
> - [Use a custom
migration.](#885 (review))
> - (and/or) Create a [Core-CMS
plugin](https://github.com/search?q=org%3ATACC+%22Core-CMS-Plugin%22&type=repositories)
(from [TACC/Django-App](https://github.com/TACC/Django-App)).

## Related

- replaces #1129

## Changes

- **rebuilt** branch from `main` + cherry-picked search-only commits
- **dropped** unrelated inherited commits (favicons, breadcrumbs,
image-zoom, etc.)

## Testing / UI

See #1129.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant