Child pages
  • [cms] Page search by content [5.2.2-B1]
Skip to end of metadata
Go to start of metadata

For large CMS websites it's crucial for users to be able to find relevant content using Search page. Unfortunately in current implementation the actual page text (what's inside content blocks) isn't used during search which might result from page relevance indicator drop (in search results) to not even showing needed page.


  1. create "PageHelper::getRevisionContent($page_revision_id)" method, that will: - 0.5h
    1. get contents of all content blocks (they belong to single page) in a given revision
    2. process content from each language separately
    3. combine content block content using space and ignoring empty values
    4. call the "html_entity_decode" function with same arguments as "htmlspecialchars_decode" in "kUtil::unescape" (replaces " " and similar things with searchable equivalents)
    5. call the "strip_tags" (removed HTML tags)
    6. 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
  2. add "lX_PageContent" column (X is language id) to the "PageRevisions" table: - 0.5h
    1. add multi-lingual field declaration in the unit config
    2. create "CoreUpgrades::Upgrade_5_2_2_B3" method (see similar methods in that class), that will only when "$mode == 'after'":
      1. call "\kMultiLanguageHelper::createFields" method to create new multilingual fields in "PageRevisions" table
      2. populate created fields using "PageHelper::getRevisionContent" method for each of existing page revisions
  3. create "page-revision:OnAfterPageContentChangedHook" event, that will: - 0.5h
    1. be a hook to "content:OnAfterItemCreate", "content:OnAfterItemUpdate" and "content:OnAfterItemDelete" events
    2. load page revision object associated with affected content block
    3. call "PageHelper::getRevisionContent" method to rebuild content
    4. store above retrieved content to loaded page revision in database
  4. add record to "SearchConfig" table to: - 0.5h
    1. appear in "Configuration > Website > Search" section
    2. 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

Related Tasks

INP-1744 - Getting issue details... STATUS


  1. Some related work as been done already in rCCD15050 commit.

  2. The information collected after implementing above plan can be used to enhance Admin Console's sections grid by showing an icon (not sure about UI, maybe a cell/row background would work better) to distinguish different section types:

    • CMS pages with content
    • folders only

    That would address the comment.


    Dmitry Andrejev [Intechnic], what is your opinion on this sections grid enhancement idea?