Contents tagged with "Orchard_1_10"

  • Migrate from SQL Compact Edition to SQL Server

    The installation of Orchard CMS is really fast and you do not even need SQL Server because Orchard CMS can run with SQL Server Compact. SQL Compact is great for development and small websites e.g. Landing Pages. In this post I will show how to migrate from SQL Compact Edition to SQL Server in 5 simple steps.

    Download the ExportSqlCE40.exe from here and copy the ExportSqlCE40.exe to SDF location e.g. \src\Orchard.Web\App_Data\Sites\Default 

    Open CMD in the SDF folder (Shift + Right Click, …

    Read More 
  • Add font size and font color select to TinyMCE

    TinyMCE is a great editor, but by default is not enabled the font size and font color select.The enabling of this two features is really easy.

    Go to \src\Orchard.Web\Modules\TinyMce\Scripts\ and open orchard-tinymce.js.

    Inside tinyMCE.init there is a toolbar property. After the formatselect add forecolor fontsizeselect.

    Now the toolbar property should look like this:

    toolbar: "undo redo cut copy paste | bold italic | bullist numlist outdent indent formatselect forecolor fontsizeselect | …

    Read More 
  • Recent Blog Posts with jQuery

    Recent Blog Posts widget of Orchard CMS works really good and the layout customization of a blog post is a piece of cake with placement.info. But maybe you need to have different layouts for recent blog posts widgets or maybe you want to share your blog posts to other sites. With this jQuery script, you can do it!

    First of all, you need jQuery installed to your site or to the site that you will share your blog posts. I didn’t write any CSS so if you want to see the same results as me, you …

    Read More 
  • Responsive iFrame - Layout Snippet

    Layout Snippets it's one of my favourites features of Orchard. Orchard 1.10 provides parameterizable snippets, that are more powerful. In this post, I will create a responsive iFrame parameterizable snippet. iFrames are very useful to websites, for example, a YouTube video or a Google Map. You can get the HTML of an iFrame and you can post it to your website, but it will not be responsive. 

    First of all, we have to install Bootstrap to our website. After this, we will a create a cshtml file …

    Read More 
  • Authenticated User - Layout Snippet

    Snippets are Layout Elements that you can drag n drop into the layout canvas. You add them to the Views folder of your theme and they have to end with Snippet.cshtml. Layout Snippets it's one of my favourites features of Orchard.  

    In this Blog Post, I will show you how to make a Page only accessible for authenticated users. There are plenty of ways to do it but I will use the Layout Snippet way. 

    If a user is not Logged In the WorkContext.CurrentUser will be null. 

    We will a create a …

    Read More 
  • Convert Orchard messages to Toastr notifications with JavaScript

    Orchard messages appear as text messages in the Messages Zone. But sometimes we need something fancier than a simple text.

    In this example, I will use Toastr non-blocking notifications.  

    First, we will hide the messages, you can do it with CSS, but in this example, I will use only JavaScript. 

    $('.zone-messages .message').css('display', 'none');

    After this, we will get all the messages and we will appear the correct type of Toastr notification. 

    var messageElement;$('.zone-messages . …

    Read More 
  • Export Form Submissions to CSV with JavaScript

    Orchard 1.10 gives you the opportunity to export Contents and Form Submissions to XML with the built-in module Import Export. If you want to change this functionality, you have to create a module that will export to CSV. But there is a quicker way with my best friend JavaScript. 

    First, we will create an export button that will appear only in the Form Submissions Page:

    var url = window.location.href.toString().toLowerCase(); if (url.indexOf('submissionadmin') > -1) {    $('<a/>', {        …

    Read More 
  • Disable Submit Button on Form Submit

    When a form is being submitted, sometimes, as the users are waiting, they might click more than once the submit button. This may cause duplicates submissions. 

    First, we will disable the submit button when the form is valid.

    $('form').submit(function () {    if ($(this).valid()) {        $(this).find('button[type="submit"]').prop('disabled', true);    }});

    We can make it more beautiful if we add a loader as the user is waiting. For the loader in this example, I used FontAwesome Fonts. 

    $(' …

    Read More