- create "PageHelper::getRevisionContent($page_revision_id)" method, that will: - 0.5h
- get contents of all content blocks (they belong to single page) in a given revision
- process content from each language separately
- combine content block content using space and ignoring empty values
- call the "html_entity_decode" function with same arguments as "htmlspecialchars_decode" in "kUtil::unescape" (replaces " " and similar things with searchable equivalents)
- call the "strip_tags" (removed HTML tags)
- return associative array, where each key would be in "lX_PageContent" format (X is language ID) and value would be searchable revision content on that language
- add "lX_PageContent" column (X is language id) to the "PageRevisions" table: - 0.5h
- add multi-lingual field declaration in the unit config
- create "CoreUpgrades::Upgrade_5_2_2_B3" method (see similar methods in that class), that will only when "$mode == 'after'":
- call "\kMultiLanguageHelper::createFields" method to create new multilingual fields in "PageRevisions" table
- populate created fields using "PageHelper::getRevisionContent" method for each of existing page revisions
- create "page-revision:OnAfterPageContentChangedHook" event, that will: - 0.5h
- be a hook to "content:OnAfterItemCreate", "content:OnAfterItemUpdate" and "content:OnAfterItemDelete" events
- load page revision object associated with affected content block
- call "PageHelper::getRevisionContent" method to rebuild content
- store above retrieved content to loaded page revision in database
- add record to "SearchConfig" table to: - 0.5h
- appear in "Configuration > Website > Search" section
- make "PageRevisions.lX_PageContent" (X is language ID) of currently approved page revision (the Revision number (NOT ID) is stored in "Categories.LiveRevisionNumber" column)
Quote: 2h*1.4 = 3h
Test with "Enable Revision Control for Page Content" setting turned and and off so that in case of multiple page content presence only approved version is searchable.
- implemented in
-
[Diffusion] rINP16634 Fixes INP-1744 - Make page content blocks searcheable
-
[Diffusion] rTDEF16635 Bug INP-1744 - Make page content blocks searcheable
-
[Diffusion] rTSIM16636 Bug INP-1744 - Make page content blocks searcheable
-
D343 INP-1744 Make page content blocks searcheable
(1 mentioned in)