I'm sure there is a way to do this but I don't know how.
I'd like to drop the newsletter control onto layout.master so that it is available on every page. In this version of mojo I am using the compiled version so I'd like to not have to update any code behinds.
The thing is, the newsletter module is built to take settings from the hashtable for modules. Is there a way to set those settings without code (or I guess I could us inline code) at the module level. I think this would be helpful for any custom page that wants to use a mojo module but outside of the CMS.
Hope I make sense and that someone can help.
mojoPortal Hosting & Design @ i7MEDIA!
Check out this page: http://www.mojoportal.com/same-content-on-all-pages.aspx
I think it will answer your questions.
NewsletterModule is really just a wrapper around another control that you could use directly in layout.master
<portal:Subscribe ID="subscribe1" runat="server" />
all the module is doing is setting some properties on the control, but these could also be set declaratively right on the control.
Inside the module it sets properties based on module settings like this:
subscribe1.ShowList = NewsletterShowListSetting;
subscribe1.IncludeDescriptionInList = NewsletterIncludeDescriptionInListSetting;
subscribe1.ShowFormatOptions = NewsletterShowFormatOptionsSetting;
subscribe1.HtmlIsDefault = NewsletterHtmlIsDefaultSetting;
subscribe1.ShowMoreInfoLink = NewsletterShowmoreInfoLinkSetting;
subscribe1.ShowPreviousEditionsLink = NewsletterShowPreviousEditionLinksSetting;
subscribe1.OverrideInputWidth = NewsletterOverrideInputWidthSetting;
but you can also set those properties declaratively right on the control declaration like:
<portal:Subscribe ID="subscribe1" runat="server" ShowList="true" IncludeDescriptionInList="true" HtmlIsDefault="true" ShowMoreInfoLink="true" ShowPreviousEditionsLink="true" />
I like that approach a lot better than the ModuleWrapper. I think I'll create some documentation about using the Newsletter Control in this manner.
That would be great Joe!
I placed the Subscribe control in layout.master. When trying to update some page settings the subscribe module was causing an page.validate to fail. I have not tried any other submits but guess any controls calling page.isvalid would cause this error. Not sure if this is a bug or something in my implementation.
P.S. Thanks for all the community help. It really makes my life easier (guess it's time to buy some more beers).
I guess technically it is a bug since it can be fixed.
Basically the issue is that we are calling Page.Validate(); before we save page settings and this causes it to validate all items on the page.
The solution is to use a validation group and only validate the group, actually we already have the validation group for pagesettings so changing the code like this should solve it.
The subscribe control internally already does it correctly so it won't affect other items on a page like this:
I will fix this, let me know any other pages where it happens as I expect it will happen elsewhere on administrative pages where I wasn't anticipating other things on the page that may have validators. I'll look around in the admin pages myself.