Content & Style Templates + JQuery

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
6/8/2010 9:29:47 AM
Gravatar
Total Posts 116

Content & Style Templates + JQuery

First off Joe, I think I have underestimated mojo portal by quite some margin!  When I first looked at it I thought it looked pretty good and was very surprised at the power and versatility that comes straight out of the box which, when complemented with your very extensive documentation leads even relative newbies like me in the right direction.  However, having started to use is to build a site I have so far done some custom skinning, altered the site appearance, a couple of installs and an upgrade and all have been virtually painless!  In addition when I have thought what I would really like to do is, or wouldn't it be good if....... the options have usually been there in the feature settings, in short Joe excellant job on creating such an awesome product!  smiley

At the moment I am concentrating very much on the 'front end' with presentation stuff, brushing up on my CSS and learning to utilise some of the cool jquery stuff (which is another great feature on mojoportal - you can do that and still create very complex websites!) and a couple of things that would me very useful for me to know are:

1.  I was looking at content templates as they are such a great starting point for end users and I was trying to figure out how you had created the templates for the jquery features such as accordion and tabs - I spent a while searching for any sign of the <div class="mojo-tabs"> but came up empty handed. I also tried to search for some signs of the content template itself in the deployment files but came up empty handed.  I was hoping that if I found those I could use them as the basis for more templates like them - are they viewable or are they stored in the database / CDN?  If not can you suggest a starting point for adding more content templates based on JQuery widgets and once created is there a way to share them in the mojoportal community?

2.  Similar to the above with the style templates which are a great idea.  I understand that I can create my own css file and add it to the config file so that it gets added in and can then add it in via the mojo admin panel.  This is great as I can create ones I commonly wish to use and copy them around several sites pretty quickly - can something similar be done with content templates at the moment?

3.  Odd one but on creating a html content instance and going to General and choosing an icon - where should this icon appear?

4.  Perhaps I should add this one to the feature request/suggestions forum but one thought I did have was that it would be extremely useful to have some batching options on newsletters.  On the shared hosting / vps options that I have used there are quite strict limits on how many emails per hour you can send and you could be a victim of your own success if you get a lot of subscribers.  My shared hosting was limited to 200 emails per hour and my vps is 500 and I guess other hosting companies apply similar limits so for those on non dedicated servers this would be a very handy feature.  I used Oceans12 mail manager a few times and you could set the number of emails to go out per minute for example.

Regards

Andrew

 

6/9/2010 6:57:23 AM
Gravatar
Total Posts 18439

Re: Content & Style Templates + JQuery

Hi Andrew,

The jQuery widgets are wired up with a small bit of javascript added to the page by our ScriptLoader

<script type="text/javascript" > $('div.mojo-accordion').accordion(); $('div.mojo-accordion-nh').accordion({autoHeight: false}); $('div.mojo-tabs').tabs(); </script>

If you need to wire up additional widgets you could make your own custom script loader control and add it to your layout.master file or you could directly add initialization script at the bottom of layout.master

We don't currently have import/export of content templates and styles but it has been requested and will eventually be implemented, it isn't a top priority though.

The icons for feature instances are only used in the MyPage feature when you make a content instance available to MyPage then the icon is shown in the web part catalog where you can add content to MyPage.

I will put it on my to do list to make it possible to make the newsletter send task have a setting that can make it throttle how fast email is sent or pause in between sending them or something similar.

Best,

Joe

6/9/2010 7:33:37 AM
Gravatar
Total Posts 116

Re: Content & Style Templates + JQuery

Hi Joe,

Thanks for the info and pointing me in the right direction to get started.

Out of interest then where are the existing content templates currently stored once they are created? Are they an object in the db?  I think that the way the style templates work is great as it is very easy to implement and also very easy to port between sites if you use a seperate file them.

Keep up the great work.

Regards

Andrew

6/9/2010 7:48:30 AM
Gravatar
Total Posts 18439

Re: Content & Style Templates + JQuery

Both content templates and style templates are stored in the db in the mp_ContentTemplate and mp_ContentStyle tables.

style templates don't work unless there is corresponding css in css files, but the style templates themselves are not stored in files, so until we implement import and export there isn't an easy way to share them from one site or installation to another, though you can copy the css files around, you still would need to define the style templates in each site.

Best,

Joe

6/9/2010 8:01:53 AM
Gravatar
Total Posts 116

Re: Content & Style Templates + JQuery

Thanks Joe, feel like I should have taken a look at the database structure before asking that question and taken a 'wild guess' now! blush

I appreciate that the css file would need to be copied and the templates added in but that still seems like a good and easy way to do it and won't take very much effort.  Of course if/when you get round to doing an export system it will be easier still, but for the time being I think it is a pretty easy way of doing it anyway.

I am not that experianced on sql databases (too much time in access with vba) but would imagine that it might be possible to run a query to copy templates from one site DB to another with a bit of trial and error which wouldn't be of much use to standard users but could be used by people installing multiple sites.

6/9/2010 8:12:18 AM
Gravatar
Total Posts 18439

Re: Content & Style Templates + JQuery

yes, it could be done by queries from one site to another in a single installation

I got my start as a developer with Access/VBA as well, way back in 1996

Cheers,

Joe

6/9/2010 8:21:24 AM
Gravatar
Total Posts 116

Re: Content & Style Templates + JQuery

Thanks Joe, looks like I have a 'couple' of years catching up to do from VBA then! wink

I had a quick look at the database and found the content template that I created yesterday when I was messing with settings so have my starting point now thanks. 

Regards

Andrew

6/9/2010 8:33:25 AM
Gravatar
Total Posts 18439

Re: Content & Style Templates + JQuery

Hey Andrew,

Thanks for the cup of coffee! Much appreciated.

Cheers,

Joe

6/9/2010 8:38:27 AM
Gravatar
Total Posts 116

Re: Content & Style Templates + JQuery

Least I can do Joe, thanks for your help.

Cheers

Andrew

4/2/2011 8:23:31 AM
Gravatar
Total Posts 18439

Re: Content & Style Templates + JQuery

Perhaps I should add this one to the feature request/suggestions forum but one thought I did have was that it would be extremely useful to have some batching options on newsletters.  On the shared hosting / vps options that I have used there are quite strict limits on how many emails per hour you can send and you could be a victim of your own success if you get a lot of subscribers.  My shared hosting was limited to 200 emails per hour and my vps is 500 and I guess other hosting companies apply similar limits so for those on non dedicated servers this would be a very handy feature.  I used Oceans12 mail manager a few times and you could set the number of emails to go out per minute for example.

fyi, I implemented this so it will be in the next release. I ran into some problems with sending my February newsletter where I got some non-delivery reports that indicated I was sending them too fast, for example one said I sent to many to @msn.com per hour, so it began treating them as spam and prevented some users with @msn.com email addresses from receiving the newsletter. So when it was time to send the March newsletter I thought about the problems from February and made it a priority to implement a way to throttle the sending. So in the next release of mojoPortal you will be able to limit it with this setting:

<add key="NewsletterMaxToSendPerMinute" value="10" />

whatever number you enter there it will send that many then it will sleep the thread for 1 minute to make sure it doesn't send more than that many per minute. It really seemed to help a lot and I had no problems with sending the March newsletter.

Best,

Joe

4/4/2011 2:59:37 AM
Gravatar
Total Posts 116

Re: Content & Style Templates + JQuery

Thanks Joe another great addition smiley

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