Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EE6] Search results excerpt does not take account of expansion of template variables #1085

Closed
PaulBaileyAtChan opened this issue May 18, 2021 · 2 comments · Fixed by #2757 or #3046
Closed

Comments

@PaulBaileyAtChan
Copy link

Where the excerpt from a channel entry shown in search results contains a template variable, this variable is expanded/replaced after the search excerpt is generated. This is consistent with the template rendering order shown at https://docs.expressionengine.com/latest/templates/engine.html, but can create some inappropriate effects:

  • The resulting excerpt can be significantly longer than the documented excerpt length of 50 words.

  • The resulting excerpt will retain any markup present in the template variable. This can cause unintended presentation effects when displaying search results, and contradicts the documentation, which states that "HTML markup is stripped prior to output".

Notwithstanding the standard EE template processing order, search excerpts should be generated — including limiting to 50/n words, and stripping markup — after all EE tags have been rendered, including template variables.

EE 6.0.4

@intoeetive
Copy link
Contributor

intoeetive commented Jan 16, 2023

Unfortunately at the moment when the included template variable (such as {logged_in_screen_name} ) is parsed, the parser already is not aware about context - whether is is displaying as part of {excerpt} (so needs to be limited to 50 characters) or as part of {full_text} (so no limit should be applied)

Personally I think that because the included variable's contents is not included in search, it should also not be included into search results - so all included template variable tags should be removed.

But if there are other thoughts, I'd like to hear those. @PaulBaileyAtChan @robinsowell @bryannielsen @matthewjohns0n

@PaulBaileyAtChan
Copy link
Author

Removing template variable tags completely from search excerpts seems a good practical solution to this. I'd be more than okay with that, if it's relatively easy to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants