?
avatar venomdev
venomdev
3 Jun 2021

Steps to reproduce the issue

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.

Expected result

Load the requested module

Actual result

Load module unable to find the short code so returns without replacing the shortcode.

System information (as much as possible)

Joomla v3.9.x

Additional comments

The line that fails is here.

if (strpos($article->text, 'loadposition') === false && strpos($article->text, 'loadmodule') === false)

Must also adjust the regex replacement with full text if it's found in the full text property.

avatar venomdev venomdev - open - 3 Jun 2021
avatar joomla-cms-bot joomla-cms-bot - change - 3 Jun 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 3 Jun 2021
avatar brianteeman
brianteeman - comment - 3 Jun 2021

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

avatar venomdev
venomdev - comment - 3 Jun 2021

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.

avatar venomdev venomdev - change - 3 Jun 2021
The description was changed
avatar venomdev venomdev - edited - 3 Jun 2021
avatar brianteeman
brianteeman - comment - 3 Jun 2021

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

avatar venomdev
venomdev - comment - 3 Jun 2021

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.

avatar brianteeman
brianteeman - comment - 3 Jun 2021

Almost definitely a template issue. Please close this here and if you still have issues then please use the forum for support

avatar venomdev
venomdev - comment - 3 Jun 2021

Ok, I've just tested on a default template. It does look like a template or some other site issue.

Thanks.

avatar venomdev venomdev - change - 3 Jun 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-06-03 07:19:47
Closed_By venomdev
avatar venomdev venomdev - close - 3 Jun 2021
avatar zzella
zzella - comment - 14 Sep 2021

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.

avatar venomdev
venomdev - comment - 14 Sep 2021

@zzella I had to rename and modify the loadmodule plugin as a special use plugin. The default plugin still works on text and the custom version works on full text. I couldn't convince the designer to rewrite his template.

avatar zzella
zzella - comment - 15 Sep 2021

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.

Add a Comment

Login with GitHub to post a comment