Surendra Sharma

Surendra Sharma

Search This Blog

Thursday, February 23, 2017

Sitecore certification in FREE of cost

Sitecore certification is very costly. However, there is one excellent and FREE way to do the basic Sitecore certification for beginner’s track.

Get basic certified by following  

  • Register yourself at https://elearning.sitecore.net
  • Login to eLearning portal
  • Select Sitecore® Developer Foundations eLearning course
  • Complete below modules available with this course
    • Setup Guide
    • Download Installer
    • Download the Student Resources Folder (You will need these files for the course labs)
    • Defining Sitecore
    • Building the Site’s Data Infrastructure
    • Creating the Site’s Content Structure
    • Working with Sitecore Publishing
    • Creating and Applying Presentations
    • Sitecore Solution Foundations eLearning Survey
  • Complete below modules available with this course
  • You will get nicely formatted PPT slide desk, transcript for each slide, CSS, JS, cshtml files, videos, and exercise workbooks.
  • Aprt from videos, rest all are available for download.
    You can complete this course with your pace but within 90 days from your registration date.
     
  • At the end of the course you will honored with below certificate


Sitecore Developer Foundations eLearning Certificate
Sitecore Developer Foundations eLearning Certificate

 
What are you waiting for? Grab your Sitecore Developer Foundations certificate now !!!

Happy Sitecoring 😊

Wednesday, February 22, 2017

Different ways to dynamically render WFFM Form in MVC



In my last article, I talk about how to dynamically render WFFM form in MVC by specifying hard coded form item Id. But that’s not a good thing.

Let’s take example of below code

@Html.Sitecore().Rendering("{F2CCA16D-7524-4E99-8EE0-78FF6394A3B3}", new
                        {
                            Datasource = "{C316B617-0306-454E-8729-E44F49B84CDD}",
                            UniqueId = "{C316B617-0306-454E-8729-E44F49B84CDD}"
                        });

How to pass form item id to this rendering method?

Query String

One way to avoid hard coded GUID is to use query string. Pass your form id as a query string as

Process this query string in your cshtml file as
@{
    if (!string.IsNullOrEmpty(Request.QueryString["FormID"]))
    {
        string wffmFormGUID = Request.QueryString["FormID"];
       
        // Validate GUID before passing to Rendering method
       
        @Html.Sitecore().Rendering("{F2CCA16D-7524-4E99-8EE0-78FF6394A3B3}", new { Datasource = wffmFormGUID, UniqueId = wffmFormGUID });
    }
}

The problem with query sting is that users can view, alter them and that can affect the rendering process. Also from SEO prospective query string is not a good option.

Model

Better option is pass the WFFM form id with model in MVC Action Method as

public ActionResult RenderWFFMForm()
{
       Messanger obj = new Messanger();
       obj.WFFMFormId = "{354813EE-441A-472B-84BD-EB430B26B734}";

       return View("RenderWFFMForm", obj);
}

Use below code in view

            <div id="wffmFormDiv">
                @{
                    if (string.IsNullOrEmpty(Model.WFFMFormId))
                    {
                        string wffmFormID = Model.WFFMFormId;

                        if (!string.IsNullOrEmpty(wffmFormID))
                        {
                            <div>
                                    @Html.Sitecore().Rendering("{F2CCA16D-7524-4E99-8EE0-78FF6394A3B3}", new
                                    {
                                        Datasource = wffmFormID,
                                        UniqueId = wffmFormID
                                    })
                            </div>
                        }
                    }
                }
            </div>

You can also pass form id using TempData, ViewData or ViewBag as well.

I hope you like this Sitecore tip. Stay tuned for more Sitecore related articles.

Till that happy sitecoring :)

Please leave your comments or share this tip if it’s useful for you.