Hi,
I believe I posted a question relating to this when I was new to DNN, but I guess I always presumed that the community would fix it.
The problem is that if I set a Module to Display on all pages, then save the page layout that I'm happy with to disk, subsequent pages that I add each get a further separate copy of the original module.
e.g. In my case the module is the entire footer which is supposed to have some config - I create Page 1, save it to a template, create a new page (2) and get 2 footers, create a new page (3) and get 3 footers.
I understand how Show on all pages work, and can get the effect by manually inserting an existing module, I note that it's the same module ID, it's just that importing a template breaks the link.
Looking at the code, it's clear that DeserializeModule always creates a new one, which is "always" going to break it - I figure that the logic should run as follows:
1) Check if the module was saved from the same portal (because the effect wouldn't work on a different portal).
1a) When importing to a different portal, tell the user that the effect doesn't work and make suggestions on how to resolve (i.e. saving a new template page). Create the module as now, i.e. next ID in sequence.
2) If same portal, detect if the numbered module exists:
2a) If it exists, create a link to the existing module
2b) If it doesn't exist, create a new module, but create with the given module ID (might have problems with key constraint etc. but has to be done).
Note: Clearly the originating portal guid would have to be written to the Template, and passed through to the Deserialize functions (or have some kind of DeserializeContext on the Request).
I don't know what the party-line is on why this hasn't been rectified, but surely DotNetNuke needs to be completely in sync with itself - surely that's more important than new graphics or features. Correct operation of Templates with alltabs==true should be looked at by someone shouldn't it?
I may look at this issue during my next couple of projects, a couple of questions though:
1) Can anybody see any gaping holes in my suggested approach or reasoning?
2) If I do fix it, what's the simplest way to get the fix considered for inclusion in an official build? I don't really want to be massively out of whack with the distribution if possible.
Kind Regards,
Mark