need to change a loto of modules - custom-css-class

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
9/19/2011 6:40:32 AM
Gravatar
Total Posts 122

need to change a loto of modules - custom-css-class

Hi Joe,

I'm working on an exiting site on sql, asp4, version 2.3.6.7

On one module I've applied a custom css class, but I need to apply the same even on a lot (around 150) other modules. So I decided to do a sql update query

I've tried to figure out where (table_name) on sql I can find the custom css class associated to the module, but i have not found it

can you help me ??

 

thanks a lot from rome

Michele Ciotti

 

9/19/2011 11:50:25 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: need to change a loto of modules - custom-css-class

Hi Michele, unfortunately this is a bit complicated, and if you are going to follow my examples, I recommend you back up your database before making any changes.

The custom CSS class name value is stored in mp_moduledsettings for all of the feature instances, as a name/value pair. If you look in mp_moduledefinitionsettings, you'll see that there are three different names for this setting, depending on the type of feature: 'CustomCssClassSetting', 'HtmlCustomCssClassSetting', and 'LinksExtraCssClassSetting'.

So for example, if you are changing from one custom CSS class to another, just for HTML features, you can do a simple update like:

update mp_modulesettings set SettingValue = 'MyNewCSSClass' where SettingName = 'HtmlCustomCssClassSetting' and SettingValue = 'MyOldCSSClass';

But there is one other twist I discovered while researching this. If you have been using mojoPortal for awhile as we have, you may have features for which the custom CSS class setting has not been stored. This is because the custom CSS class setting is relatively new, and features that were created before the setting was available, and have not had settings updated, will not have these setting rows stored in the database. So as another example, you can determine which HTML features do not have this setting stored by running the following query. For the returned feature instances, you would need to manually update the CSS class on each. Note that if you are not working with HTML features, you can get the appropriate FeatureGuid value from the mp_moduledefinitions table.

select a.ModuleID, a.ModuleTitle from mp_modules a
where a.FeatureGuid = '881e4e00-93e4-444c-b7b0-6672fb55de10'
and not exists (select 'x' from mp_modulesettings b
where b.ModuleID = a.ModuleID
and b.SettingName = 'HtmlCustomCssClassSetting');

Hope that helps,
Jamie

9/21/2011 12:02:44 AM
Gravatar
Total Posts 122

Re: need to change a loto of modules - custom-css-class

Hi Jamie,

works great..

thank you so much !!

Michele (Rome)

You must sign in to post in the forums. This thread is closed to new posts.