Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-1744

Make page content blocks searcheable

    XMLWordPrintable

    Details

    • Type: Feature Request
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2.2-B3
    • Component/s: CMS

      Description

      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

       

      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.

        Attachments

        1. INP-1744-2018-05-10.patch
          7 kB
          Gleb Sinkovskiy [Intechnic]
        2. searchable_content_blocks.patch
          7 kB
          Erik Snarski [Intechnic]

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Erik Snarski [Intechnic]
                Reviewer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 3h Original Estimate - 3h
                  3h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 9h 53m
                  9h 53m