-Create a banner, including some meta keywords.
-Create a banner module an setup the option "Search by Meta Keyword" to "YES".
-Activate the module in any position let's say "position-7" on Protostar template
-Disable the cache for the banners module and save.
-Create a Content article and setup some Meta Keywords which will be used to display the banner accordingly.
-Embed the module Banners inside the article using the "Module" button on the tinyMCE editor (the syntax will look something like this {loadmodule mod_banners,banners module title} ) and save it.
-The Banners module works good and shows the banner according to the Meta Keywords in the "position-7" or any other position in the default Protostar template.
-The banners module should also work the same way when embedded inside the article, displaying the banners according to the Meta Keywords.
-The Banners module embedded inside the article shows no content at all.
-The source code shows:
< div class = " module " >
< h3 > Banners module title< / h3 >
< div class = " banner group " > < / div >
< / div >
-I tried to disable all the joomla cache and the problem still persist.
-When disabling the option "Search by Meta keyword" inside the Banners Module, the module can display his content inside the article with no issue.
Ignore my last comment
I created a banner with the meta keyword test and embedded a banner module in an article with the meta keyword test.
I then inserted a banner module in that article
When search by metakeyword was not selected a banner was displayed
When search by metakeyword was selected a banner was not displayed
Priority | Urgent | ⇒ | Medium |
Status | New | ⇒ | Confirmed |
Category | Cache Components Modules Plugins Tags | ⇒ | Components Modules Plugins |
Issue exists in 3.7-staging.
Issue still exists in 3.7.3-staging.
I have investigated the cause and found the reason for the problem.
components/com_content/views/article/view.html.php calls the onContentPrepare plugin (which in turn loads the embedded module) BEFORE it calls _prepareDocument (which sets the meta data).
Changing the order of these calls could have unforseen consequences - e.g. plugins that set the meta tags based on the content or category would break.
I can see many benefits of making the viewed article available within the loadmodule methods of the content plugin. For example a pluging that extracts the custom fields from the currently viewed article coupled with new custom module that is used to display these custom fields.
This may be a better solution - I would be interested in other people's views before suggesting some code changes.
Title |
|
||||||
Status | Confirmed | ⇒ | Discussion |
Labels |
Added:
J3 Issue
|
Status | Discussion | ⇒ | Confirmed |
Build | master | ⇒ | staging |
Confirmed also for J4.
Labels |
Added:
No Code Attached Yet
J4 Issue
bug
Removed: ? |
Trying to use it in my new site J4 , but there are no keywords in the head. Maybe I am missing a param?
yes there are no keywords in the head. that is correct.
from memory it is matching the value oif the keyword in the article and the keyword in the banner
https://github.com/joomla/joomla-cms/blob/4.1-dev/modules/mod_banners/src/Helper/BannersHelper.php#L38 The module uses <meta name="keywords" here.
I see that the related_items module searches for keywords in the article, not in <meta
banners should do it the same way now. it was missed in error
Labels |
Removed:
J3 Issue
|
Labels |
Added:
?
|
@brianteeman can you fix the missed code?
sadly not
I'm working on it - its all about knowing the $article (with its keywords) which is calling the banner module (while in BannersHelper) - that's where i'm stuck.
I have investigated the code of the banners generation and found that the rendering of banners in a banners module with 'Select by keywords' set to 'Yes' is completely broken - not just as a module in an article - since the keywords are not set in the document anymore and the BannersHelper gets it from there with $keywords = explode(',', $app->getDocument()->getMetaData('keywords')); - i have a solution for the original issue, but i'm looking for a solution fixing this for the banners in a position too - for J4 completey broken
Status | Confirmed | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-10-21 16:31:57 |
Closed_By | ⇒ | richard67 |
I followed the instructions above and can NOT confirm this on a clean install
When search by metakeyword was not selected a banner was displayed
When search by metakeyword was selected a banner was not displayed and unlike the report the raw code was not displayed
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10140.