1

I have the following problem. The {loadposition} is specified in the contribution text and appears in the article as it should. Unfortunately, I have now also in the blog view of 6 articles each other also. How can I make the {loadposition} display only once in the blog view?

Sorry for my bad english

Edit:

I would like to load a Module on a definied position. In Single article thats ok. But in the Blogview the module appears on every blogentry. I would like to show the module only at the first blog entry

Mitcha

2

You might need to give a more specific example of what the module area is doing for the ideal suggestion. However, a few ideas that might point you in the right direction:

Plugin

Create a plugin that runs before the "Content - Load Modules" plugin. You will need this to detect the page's view and, if it detects the blog category layout, strip any {loadposition} that you do not want to display so that when "Content - Load Modules" runs, the unwanted modules no longer exist in the code it is parsing.

Use Read More

Set the category view to only show the content before the Read More break, and the article view to only show the content after the Read More break. Manually place the modules where they should appear on the category view, ie on one page it will appear both above and below the Read More. This could end up being quite fiddly for the admin who may have to duplicate a lot of content, depending on how your site works.

CSS

Hide the unwanted modules using CSS in the template. Not best practise, but should be a quick-and-easy approach.

Module

Update (if your own), or override (if core or third party) the template of the module so that it counts how many times it has been loaded on a page, and output content or output nothing accordingly.

Design

Does it need to appear in the article, or could you place the module elsewhere on the page without harming usability? If the admin is having to place the same module every time an article is created, it sounds like it may be a design problem.

Update

Is there any reason why you can't create a module area in your template - above or below the component area - and assign the module via the module manager? From the information you have given - this sounds like the best approach.

  • Hi Richard,thank u very much for your answer. I would like to load a Module on a definied position. In Single article thats ok. But in the Blogview the module appears on every blogentry. I would like to show the module only at the first blog entry. – Mitcha Apr 17 '17 at 19:41
  • What is the module actually doing, and why does it need to be in the middle of an article? – Richard B Apr 17 '17 at 19:49
  • its a weather map. this map should be placed in the actual article – Mitcha Apr 18 '17 at 6:10
  • Or "the Picture of the Day" – Mitcha Apr 18 '17 at 6:20
  • Changing the design for it to appear alongside the article rather than within the article would seem the most sensible. If that can't be done, I reckon the plugin approach would be your tidiest one. If you just want to hack at the blog layout's html, then you could also just create an override of com_content's category view within your template. – Richard B Apr 18 '17 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.