7

There already exists a couple of questions on this, but they are mostly about actually wanting multiple copies of the same module on a page.

My problem is the layout and templating. Templates often have different names for the positions. I want a standardised semantic naming in templates, please ;-)

As I'm experimenting with a new template for my site I want to be able to switch back and forth between my old and new templates and compare them. And I don't want to go through all modules and give them new positions every time.

A solution would be to allow a module to be placed in multiple positions, specifically, in different module positions in different templates. E.g. "top" in Template A and "over content" in Template B, because that would make my site look similar whatever template I choose.

Is this possible? Wasn't that a feature of Joomla 1.5 or am I just dreaming? (Turns out I was dreaming...)

In essence I'm looking for a way to work seemlessly with a site upgrade, including its template. My wanted workflow would be something like

  • create a duplicate site
  • install new template
  • figure out new module positions
  • add new module positions on original site
  • install and activate new template on original site

The fourth step is the one I'm seeking a solution to.

  • Did you find the answer you were looking for? – Lance Dec 16 '15 at 19:47
  • Not really, I'll accept @FFrewin's answer since it explains that there are no tools to do what I need. – thoni56 Dec 17 '15 at 14:06
2

Happy dreaming... Not possible - back then (J1.5) and now.

But the part of experimentation is still possible.
Actually all you have to do is to leave the original site as is and do anything you like on a dev site.
This way, having 2 sites: the original and the new you are developing, you can do unlimited number of comparisons between them.

I wouldn't ever try to do what you want to do -that is changing/experimenting/developing a template- on a live site anyway... and generally it's not a recommended practice and I really don't understand how people are going and thinking this way.

Getting a copy of the site in question, restoring it somewhere where I can work with peace and no fear of anything that could go wrong, and there I am -with all the freedom to experiment and make mistakes. There are even cases that I might end up with multiple instances of the dev site.

So, although the idea of being able to publish the same module on more than 1 positions doesn't sound bad as a feature, it shouldn't actually be an obstacle for what you want to do.

Update: Duplicating Modules

I wanted to included this in my initial answer, but somehow I bypassed it... Something that could bring you closer to what you are asking, is to duplicate the modules and assign them to the new module positions. The Batch Button is of help here. It might not be the most efficient way, but it's not also that far and tough to do. When done with the old template and modules, you can delete them all together.

  • That's what I do too, but I'd still want to prepare my modules for an easy switch over. But as you say, it does not prevent me from experimenting with new templates. – thoni56 Dec 14 '15 at 16:28
  • If it were possible, I could experiment with the new template (in a different site), and when I had my wanted positions I could prepare all modules on the live site by assigning them to the new templates positions also. Still live with the old template. Then: install template, switch template, done! No restoring, no overwriting, no nightly "site down", just a pretty separation of layout from content, like it is supposed to work ;-) – thoni56 Dec 14 '15 at 16:34
  • @ThomasNilsson, well fair enough. But keep in mind that you could still do something similar if you duplicate the modules and assign them to the new module positions. At the other hand - I usually reckon a layout (template) change as an important change on a site. Working it independently on my dev - preparing everything to the last detail - when ready doing all recent db migrations if there are any, and then restoring it. My nightly site-down is actually about 5-10 sec. – FFrewin Dec 14 '15 at 16:48
  • @ThomasNilsson, just added the suggestion of the modules duplication on my answer. – FFrewin Dec 14 '15 at 16:58
  • Accepted, since it's workable and makes it a bit easier to do what I wanted than changing module assignments all the time ;-) But still not what I hoped for... – thoni56 Dec 17 '15 at 14:07
3

I am coming back here to post an alternative suggestion, after I came across an extension that could help with site changes, updates, modification, including template change.

The extension is called StageIt and what it does is adding staging capabilities to Joomla. So with this extension you can create/sync a development environment right from within your Joomla site, and start applying any change, without those changes being 'live' until you're completely ready.

When ready you can sync back and make the switch publishing the changes to live. StageIt is also taking care of backups at the moment of sync, so if anything won't go as expected, you can switch back.

  • Upvote for suggesting a solution to the underlying need, and not necessarily the question. Thanks, it looks interesting and that functionality would be an extremely useful feature. – thoni56 Jan 22 '16 at 6:40
3

One way to do this is to create your master module and put it in a custom module position, for example "master-position".

Then create a new Custom HTML module for every location you wish that custom module to be placed, by using the actual template position you wish to load the module in.

Then use {loadposition master-position} as the only content in the Custom HTML module.

You can also use {loadmodule custom-module-name} or load your module with the button called Module in the Custom HTML modules or articles.


Note: Check if you have enabled this plugin in Extensions > Plugins > Content - Load Modules

0

Some time ago I had the need to do something similar, and the best way to solve
it was doubling in the index code of each position:

<jdoc:include type="modules" name="your-position" style="html5" />
  • So if you assign a module to this position, and this position is in multiple sections
    of the template, will be charged on all.
  • And if you have multiple templates in the same site, with the positions and styles
    that are defined in both, your module will be equally loaded in all.

This increases the loading time of the site, but, of course that depends on how many
duplicates you have.

*Considers the response of @Lance, is another way to achieve multiple module
positions by using {loadposition}.*

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.