No Code Attached Yet
avatar machadoug
machadoug
11 Dec 2023

Steps to Reproduce the Issue

  1. Begin by creating an article containing a content plugin shortcode, such as {loadposition contact}.
  2. Execute the Smart Search Indexer.
  3. Proceed to search for the term "contact."

Expected Result

The anticipated outcome is to view the plugin's content, specifically the contact module position, or alternatively, the removal of the shortcode from the search result.

Actual Result

Upon searching for "contact," the result displays the shortcode instead of the expected content.

System Information

Joomla Version: Latest - Joomla 5.

Additional Comments

Presenting the shortcode to users is currently not meaningful. It would be beneficial to implement a mechanism allowing content plugins to exclude their shortcodes from the search results. Another approach could involve utilizing the process content plugins on the Smart Search results. This can be achieved by incorporating the following code into the file components/com_finder/tmpl/search/default_result.php:

$full_description = HTMLHelper::_('content.prepare', $full_description);
avatar machadoug machadoug - open - 11 Dec 2023
avatar joomla-cms-bot joomla-cms-bot - change - 11 Dec 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Dec 2023
avatar richard67
richard67 - comment - 11 Dec 2023

@machadoug The "[5.1]" in the title of your issue is misleading as this means it would only apply to the upcoming 5.1, but as far as I understand your issue is for the latest Joomla 5 version, which is 5.0.1. I will fix the title in a minute.

The alternative solution, removal of the shortcode from smart search results, has been released with 4.3.5 with PR #38998 and has been merged up into the 4.4-dev and 5.0-dev branches, see here for 5.0-dev: https://github.com/joomla/joomla-cms/blob/5.0-dev/plugins/content/loadmodule/src/Extension/LoadModule.php#L67-L82 . The corresponding issue was #38599 . @MacJoom Any idea why this might not be working with 5.0.1?

avatar richard67 richard67 - change - 11 Dec 2023
Title
[5.1][com_finder] showing content plugins shortcodes in the result
[com_finder] showing content plugins shortcodes in the result
avatar richard67 richard67 - edited - 11 Dec 2023
avatar machadoug machadoug - close - 11 Dec 2023
avatar machadoug
machadoug - comment - 11 Dec 2023

Apologies for the confusion; it appears I made an error. In reality, it does work with the loadposition in Joomla 5. I mistakenly tested it with a third-party content plugin, but my initial example involved loadposition. I've performed the tests again and it's working properly.

avatar machadoug machadoug - change - 11 Dec 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-12-11 15:02:21
Closed_By machadoug
avatar richard67
richard67 - comment - 11 Dec 2023

Thanks for checking and reporting back.

Add a Comment

Login with GitHub to post a comment