Add a read more break in an article and use the {loadmodule x} shortcode after the read more. The shortcode will only appear in the article full text property.
Edit: The {loadmodule x} shortcode is displayed in the full article after clicking the read more link.
Load the requested module
Load module unable to find the short code so returns without replacing the shortcode.
Joomla v3.9.x
The line that fails is here.
Must also adjust the regex replacement with full text if it's found in the full text property.
Labels |
Added:
?
|
No, when you go to the full article from the read more link the module is not shown. The full text section is used in the template but the load module does not scan this property.
OK I did misunderstand you. However I cannot replicate this. Couple of things to check.
First check with one of the default templates to rule out any issue with your template
Second check that the Content - Load Modules plugin is enabled
I'll do some more debugging. My designer may have done something unusual.
When I was debugging the loadmodule after clicking the read more link the article text property was still not the complete article. The text property was still limited to the intro and the full text property was the whole article with the shortcode.
Ok, I've just tested on a default template. It does look like a template or some other site issue.
Thanks.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-06-03 07:19:47 |
Closed_By | ⇒ | venomdev |
I believe the OP had the same issue as I. If you use $article->fulltext in your template instead of $article->text the {loadmodule x} or {loadposition x} tag is not interpreted. The loadmodule plugin only does a replace on the $article->text property but not the $article->fulltext property. Sounds like the OP's template was displaying the introtext and fulltext separately in order to make the their readmore function work, and for that reason was not getting their loadmodule tags interpreted.
Thanks @venomdev! As I have access to the template I ended up solving it in a different way. Apologies that this is not really the place for this discussion but for anyone looking, you can add a line to your template to run the onContentPrepare plugins on the introtext and/or fulltext properties. For example: $intro_prepared = JHtml::_('content.prepare', $this->item->introtext); echo $intro_prepared;
If it's just the fulltext you need to prepare, set the global content parameters to hide the intro, then you can use $this->item->introtext and $this->item->text separately in your template.
If I have understood you correctly then this is the expected behaviour. The readmore indicates the end of the ntro text so obviously anything placed after the break will not appear in the intro