Botwin offers an interesting alternative option for routing with ASP.NET Core

NancyFx is a great alternative to ASP.NET if you want to make elegant little web apis like this:public class SampleModule : Nancy.NancyModule
{
public SampleModule()
{
Get[“/”] = _ => “Hello World!”;
}
}

However, it may …

NancyFx is a great alternative to ASP.NET if you want to make elegant little web apis like this:

public class SampleModule : Nancy.NancyModule

{
public SampleModule()
{
Get["/"] = _ => "Hello World!";
}
}

However, it may be that you want a routing style - the way you define your routes - that is like NancyFx BUT you want to use ASP.NET. Botwin is a library that lets you do just that. They say:

This is not a framework, it simply builds on top of Microsoft.AspNetCore.Routing allowing you to have more elegant routing rather than have attribute routing, convention routing, ASP.Net Controllers or IRouteBuilder extensions.

You can plug Botwin into your existing ASP.NET Core application, or you can even add a basic started Botwin app to "dotnet new" like this:

C:\botwinexample> dotnet new -i BotwinTemplate

C:\botwinexample> dotnet new botwin -n MyBotwinApp
C:\botwinexample> dir
10/11/2017 10:14 PM 284 HomeModule.cs
10/11/2017 10:14 PM 470 MyBotwinApp.csproj
10/11/2017 10:14 PM 421 Program.cs
10/11/2017 10:14 PM 408 Startup.cs
4 File(s) 1,583 bytes

You add Botwin as a service to your ASP.NET Core app:

public class Startup

{ public void ConfigureServices(IServiceCollection services) { services.AddBotwin(); } public void Configure(IApplicationBuilder app) { app.UseBotwin(); }
}

And then add 'Modules' like this:

namespace MyBotwinApp
{
    using Botwin;
    using Microsoft.AspNetCore.Http;
    public class HomeModule : BotwinModule
    {
        public HomeModule()
        {
            Get("/", async(req, res, routeData) => await res.WriteAsync("Hello from Botwin!"));
        }
    }
}

That's a hello world. Let's try something more interesting. You can have Before and After hooks like this:

public class HooksModule : BotwinModule

{
public HooksModule()
{
this.Before = async (ctx) =>
{
ctx.Response.StatusCode = 402;
await ctx.Response.WriteAsync("Pay up you filthy animal");
return false;
};

this.Get("/hooks", async (req, res, routeData) => await res.WriteAsync("Can't catch me here"));

this.After = async (ctx) => await ctx.Response.WriteAsync("Don't forget you owe me big bucks!");
}
}

Here's a more complex example. See how they do a BindAndValidate in the Post() where they check for a valid Actor before working with it.

public class ActorsModule : BotwinModule

{
public ActorsModule(IActorProvider actorProvider)
{
this.Get("/actors", async (req, res, routeData) =>
{
var people = actorProvider.Get();
await res.AsJson(people);
});

this.Get("/actors/{id:int}", async (req, res, routeData) =>
{
var person = actorProvider.Get(routeData.As<int>("id"));
await res.Negotiate(person);
});

this.Put("/actors/{id:int}", async (req, res, routeData) =>
{
var result = req.BindAndValidate<Actor>();

if (!result.ValidationResult.IsValid)
{
res.StatusCode = 422;
await res.Negotiate(result.ValidationResult.GetFormattedErrors());
return;
}

//Update the user in your database

res.StatusCode = 204;
});

this.Post("/actors", async (req, res, routeData) =>
{
var result = req.BindAndValidate<Actor>();

if (!result.ValidationResult.IsValid)
{
res.StatusCode = 422;
await res.Negotiate(result.ValidationResult.GetFormattedErrors());
return;
}

//Save the user in your database
res.StatusCode = 201;
await res.Negotiate(result.Data);
});
}

What do you think about the choices you have with ASP.NET Core? Some people feel like the amount of plugability is overwhelming, but I find the flexibility heartening. Go check out Botwin and, hopefully, help out and contribute to open source!


Sponsor: Get the latest JetBrains Rider preview for .NET Core 2.0 support, Value Tracking and Call Tracking, MSTest runner, new code inspections and refactorings, and the Parallel Stacks view in debugger.



© 2017 Scott Hanselman. All rights reserved.
     

Botwin offers an interesting alternative option for routing with ASP.NET Core

NancyFx is a great alternative to ASP.NET if you want to make elegant little web apis like this:public class SampleModule : Nancy.NancyModule
{
public SampleModule()
{
Get[“/”] = _ => “Hello World!”;
}
}

However, it may …

NancyFx is a great alternative to ASP.NET if you want to make elegant little web apis like this:

public class SampleModule : Nancy.NancyModule

{
public SampleModule()
{
Get["/"] = _ => "Hello World!";
}
}

However, it may be that you want a routing style - the way you define your routes - that is like NancyFx BUT you want to use ASP.NET. Botwin is a library that lets you do just that. They say:

This is not a framework, it simply builds on top of Microsoft.AspNetCore.Routing allowing you to have more elegant routing rather than have attribute routing, convention routing, ASP.Net Controllers or IRouteBuilder extensions.

You can plug Botwin into your existing ASP.NET Core application, or you can even add a basic started Botwin app to "dotnet new" like this:

C:\botwinexample> dotnet new -i BotwinTemplate

C:\botwinexample> dotnet new botwin -n MyBotwinApp
C:\botwinexample> dir
10/11/2017 10:14 PM 284 HomeModule.cs
10/11/2017 10:14 PM 470 MyBotwinApp.csproj
10/11/2017 10:14 PM 421 Program.cs
10/11/2017 10:14 PM 408 Startup.cs
4 File(s) 1,583 bytes

You add Botwin as a service to your ASP.NET Core app:

public class Startup

{ public void ConfigureServices(IServiceCollection services) { services.AddBotwin(); } public void Configure(IApplicationBuilder app) { app.UseBotwin(); }
}

And then add 'Modules' like this:

namespace MyBotwinApp
{
    using Botwin;
    using Microsoft.AspNetCore.Http;
    public class HomeModule : BotwinModule
    {
        public HomeModule()
        {
            Get("/", async(req, res, routeData) => await res.WriteAsync("Hello from Botwin!"));
        }
    }
}

That's a hello world. Let's try something more interesting. You can have Before and After hooks like this:

public class HooksModule : BotwinModule

{
public HooksModule()
{
this.Before = async (ctx) =>
{
ctx.Response.StatusCode = 402;
await ctx.Response.WriteAsync("Pay up you filthy animal");
return false;
};

this.Get("/hooks", async (req, res, routeData) => await res.WriteAsync("Can't catch me here"));

this.After = async (ctx) => await ctx.Response.WriteAsync("Don't forget you owe me big bucks!");
}
}

Here's a more complex example. See how they do a BindAndValidate in the Post() where they check for a valid Actor before working with it.

public class ActorsModule : BotwinModule

{
public ActorsModule(IActorProvider actorProvider)
{
this.Get("/actors", async (req, res, routeData) =>
{
var people = actorProvider.Get();
await res.AsJson(people);
});

this.Get("/actors/{id:int}", async (req, res, routeData) =>
{
var person = actorProvider.Get(routeData.As<int>("id"));
await res.Negotiate(person);
});

this.Put("/actors/{id:int}", async (req, res, routeData) =>
{
var result = req.BindAndValidate<Actor>();

if (!result.ValidationResult.IsValid)
{
res.StatusCode = 422;
await res.Negotiate(result.ValidationResult.GetFormattedErrors());
return;
}

//Update the user in your database

res.StatusCode = 204;
});

this.Post("/actors", async (req, res, routeData) =>
{
var result = req.BindAndValidate<Actor>();

if (!result.ValidationResult.IsValid)
{
res.StatusCode = 422;
await res.Negotiate(result.ValidationResult.GetFormattedErrors());
return;
}

//Save the user in your database
res.StatusCode = 201;
await res.Negotiate(result.Data);
});
}

What do you think about the choices you have with ASP.NET Core? Some people feel like the amount of plugability is overwhelming, but I find the flexibility heartening. Go check out Botwin and, hopefully, help out and contribute to open source!


Sponsor: Get the latest JetBrains Rider preview for .NET Core 2.0 support, Value Tracking and Call Tracking, MSTest runner, new code inspections and refactorings, and the Parallel Stacks view in debugger.



© 2017 Scott Hanselman. All rights reserved.
     

Botwin offers an interesting alternative option for routing with ASP.NET Core

NancyFx is a great alternative to ASP.NET if you want to make elegant little web apis like this:public class SampleModule : Nancy.NancyModule
{
public SampleModule()
{
Get[“/”] = _ => “Hello World!”;
}
}

However, it may …

NancyFx is a great alternative to ASP.NET if you want to make elegant little web apis like this:

public class SampleModule : Nancy.NancyModule

{
public SampleModule()
{
Get["/"] = _ => "Hello World!";
}
}

However, it may be that you want a routing style - the way you define your routes - that is like NancyFx BUT you want to use ASP.NET. Botwin is a library that lets you do just that. They say:

This is not a framework, it simply builds on top of Microsoft.AspNetCore.Routing allowing you to have more elegant routing rather than have attribute routing, convention routing, ASP.Net Controllers or IRouteBuilder extensions.

You can plug Botwin into your existing ASP.NET Core application, or you can even add a basic started Botwin app to "dotnet new" like this:

C:\botwinexample> dotnet new -i BotwinTemplate

C:\botwinexample> dotnet new botwin -n MyBotwinApp
C:\botwinexample> dir
10/11/2017 10:14 PM 284 HomeModule.cs
10/11/2017 10:14 PM 470 MyBotwinApp.csproj
10/11/2017 10:14 PM 421 Program.cs
10/11/2017 10:14 PM 408 Startup.cs
4 File(s) 1,583 bytes

You add Botwin as a service to your ASP.NET Core app:

public class Startup

{ public void ConfigureServices(IServiceCollection services) { services.AddBotwin(); } public void Configure(IApplicationBuilder app) { app.UseBotwin(); }
}

And then add 'Modules' like this:

namespace MyBotwinApp
{
    using Botwin;
    using Microsoft.AspNetCore.Http;
    public class HomeModule : BotwinModule
    {
        public HomeModule()
        {
            Get("/", async(req, res, routeData) => await res.WriteAsync("Hello from Botwin!"));
        }
    }
}

That's a hello world. Let's try something more interesting. You can have Before and After hooks like this:

public class HooksModule : BotwinModule

{
public HooksModule()
{
this.Before = async (ctx) =>
{
ctx.Response.StatusCode = 402;
await ctx.Response.WriteAsync("Pay up you filthy animal");
return false;
};

this.Get("/hooks", async (req, res, routeData) => await res.WriteAsync("Can't catch me here"));

this.After = async (ctx) => await ctx.Response.WriteAsync("Don't forget you owe me big bucks!");
}
}

Here's a more complex example. See how they do a BindAndValidate in the Post() where they check for a valid Actor before working with it.

public class ActorsModule : BotwinModule

{
public ActorsModule(IActorProvider actorProvider)
{
this.Get("/actors", async (req, res, routeData) =>
{
var people = actorProvider.Get();
await res.AsJson(people);
});

this.Get("/actors/{id:int}", async (req, res, routeData) =>
{
var person = actorProvider.Get(routeData.As<int>("id"));
await res.Negotiate(person);
});

this.Put("/actors/{id:int}", async (req, res, routeData) =>
{
var result = req.BindAndValidate<Actor>();

if (!result.ValidationResult.IsValid)
{
res.StatusCode = 422;
await res.Negotiate(result.ValidationResult.GetFormattedErrors());
return;
}

//Update the user in your database

res.StatusCode = 204;
});

this.Post("/actors", async (req, res, routeData) =>
{
var result = req.BindAndValidate<Actor>();

if (!result.ValidationResult.IsValid)
{
res.StatusCode = 422;
await res.Negotiate(result.ValidationResult.GetFormattedErrors());
return;
}

//Save the user in your database
res.StatusCode = 201;
await res.Negotiate(result.Data);
});
}

What do you think about the choices you have with ASP.NET Core? Some people feel like the amount of plugability is overwhelming, but I find the flexibility heartening. Go check out Botwin and, hopefully, help out and contribute to open source!


Sponsor: Get the latest JetBrains Rider preview for .NET Core 2.0 support, Value Tracking and Call Tracking, MSTest runner, new code inspections and refactorings, and the Parallel Stacks view in debugger.



© 2017 Scott Hanselman. All rights reserved.
     

How to Disable the Search Feature in WordPress

Do you want to disable the search feature in WordPress? Sometimes your site may not need the search feature and the search form in your theme may interfere with user experience. In this article, we will show you how to easily disable the search feature… Read More »

The post How to Disable the Search Feature in WordPress appeared first on WPBeginner.

Do you want to disable the search feature in WordPress? Sometimes your site may not need the search feature and the search form in your theme may interfere with user experience. In this article, we will show you how to easily disable the search feature in WordPress.

Disabling search feature in WordPress

Why and Who Should Disable Search Feature in WordPress?

Many WordPress websites are simple business websites with a few pages. There is also a growing trend of one-page websites with vertical navigation.

These websites does not have much content which makes search form a novelty item and not a useful feature.

It also gives users the impression that there might be some other information that they can’t see and hence the search option. Removing search feature will clean up your website and offer a better user experience.

That being said, let’s take a look at how to easily remove search feature from your WordPress site.

Method 1. Remove Search Feature in WordPress Using a Plugin

This method is easier and is recommended for all users.

First thing you need to do is install and activate the Disable Search plugin. For more details, see our step by step guide on how to install a WordPress plugin.

The plugin works out of the box, and there are no settings for you to configure.

Upon activation, it will remove search form from your WordPress theme and disable the search widget. If a user directly tried to enter a search query URL, the plugin will return a 404 error page.

Note that this plugin does not affect the search functionality inside the WordPress admin area. You can still search posts and pages inside your WordPress admin.

Method 2. Manually Disable Search Feature in WordPress

This method requires you to add code to your WordPress files. If you haven’t done this before, then take a look at our guide on how to copy and paste code in WordPress.

You will need to add this code to your theme’s functions.php file or a site-specific plugin.

function wpb_filter_query( $query, $error = true ) {
if ( is_search() ) {
$query->is_search = false;
$query->query_vars[s] = false;
$query->query[s] = false;
if ( $error == true )
$query->is_404 = true;
}
}
add_action( 'parse_query', 'wpb_filter_query' );
add_filter( 'get_search_form', create_function( '$a', "return null;" ) );
function remove_search_widget() {
	unregister_widget('WP_Widget_Search');

add_action( 'widgets_init', 'remove_search_widget' );

This code will simply redirect all direct or indirect search queries to a 404 page. It will also hide the search form in your WordPress theme.

Search form widget removed

We hope this article helped you learn how to easily disable search feature in WordPress. You may also want to see our mega list of the most wanted WordPress tips, tricks, and hacks.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Disable the Search Feature in WordPress appeared first on WPBeginner.

Beginner’s Guide: What is a Domain Name and How Do Domains Work?

We are often asked by beginners: what is a domain name and how do domains work? Many of our beginner users confuse domain names with hosting and other services. In this beginner’s guide, we will answer what is a domain name and how domains work.… Read More »

The post Beginner’s Guide: What is a Domain Name and How Do Domains Work? appeared first on WPBeginner.

We are often asked by beginners: what is a domain name and how do domains work? Many of our beginner users confuse domain names with hosting and other services. In this beginner’s guide, we will answer what is a domain name and how domains work.

Domain names and how do they work?

What is a Domain Name?

Domain name is the address of your website that people type in the browser URL bar to visit your website.

In simple terms, if your website was a house, then your domain name will be its address.

A more detailed explanation:

Internet is giant network of computers connected to each other through a global network of cables. Each computer on this network can communicate with other computers.

To identify them, each computer is assigned an IP address. It is a series of numbers that identify a particular computer on the internet. A typical IP address looks like this:

66.249.66.1

Now an IP address like this is quite difficult to remember.

Domain names were invented to solve this problem.

Now if you want to visit a website, you don’t need to enter a long string of numbers. Instead, you can visit it by typing an easy to remember domain name in your browser’s address bar. For example, wpbeginner.com.

What happens when you enter a domain name in your browser?

How domains work

Your browser sends a request to a global network of servers that form the Domain Name System. These servers then look up for the name servers associated with a domain and forward the request to those name servers.

For example, if your website is hosted on Bluehost, then it’s name server information will be like this:

ns1.bluehost.com
ns2.bluehost.com

These name servers are computers managed by your hosting company. Your hosting company now forwards your request to the computer where your website is stored.

This computer is called a web server. It has a special software installed (Apache, Nginx are two popular web server software). The web server now fetches the requested website and sends it to back to the browser.

How is Domain Name Different from Web Hosting?

web hosting

If domain name is the address of your website, then web hosting is the home where your website lives.

This is the actual computer where your website’s files are stored. These servers are offered as a service by hosting companies.

To create your website, you need both domain name and web hosting.

However, it’s important to remember that they are two separate services, and you can buy them from two different companies.

Now you may be wondering, how would it work if you bought them from two separate companies?

You just need to edit your domain name settings and enter the Name Server information provided by your hosting company. Name Server information defines where to send user requests for your domain name.

We recommend getting both your domain name and hosting from the same company. This allows you to easily manage your domain and hosting under the same account.

How to Choose a Domain Name for Your Website?

Choosing domain name

Domain names are available in many different extensions. The most popular one is .com. There are many other options like .org, .net, .tv, .info, .io, and more.

There are also country specific domain names which end with country code extension like .uk for United Kingdom, .de for Germany, .in for India.

We recommend using .com, mainly because it is the easiest to remember and works best for business websites.

For more on this topic, please take a look at our guide on how to choose the best domain name.

How to Buy a Domain Name?

You can buy domain names from many companies. These companies are called domain name registrars. A domain name typically costs 14.99 per year. Some popular domain name companies are:

However, a domain name registration does not automatically give you hosting service. For that you will need a website hosting account as well.

Many WordPress hosting companies offer domain name registration services as well. This allows you to manage both services under one account, and you also don’t need to worry about changing name server settings for your domain.

We recommend using Bluehost. They are offering WPBeginner users a free domain name and 60% discount on hosting. Basically you can get started for $2.75/month.

We hope this article helped you learn what is a domain name and how do domains work. You may also want to see our list of best free domain name generators to find cool ideas for your next domain name.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post Beginner’s Guide: What is a Domain Name and How Do Domains Work? appeared first on WPBeginner.

How to Build an Amazon Affiliate Store Using WordPress

Do you want to build an Amazon affiliate store using WordPress? An Amazon affiliate store allows you to sell products from Amazon.com as an affiliate and earn a commission. In this article, we will show you how to easily build an Amazon affiliate store using… Read More »

The post How to Build an Amazon Affiliate Store Using WordPress appeared first on WPBeginner.

Do you want to build an Amazon affiliate store using WordPress? An Amazon affiliate store allows you to sell products from Amazon.com as an affiliate and earn a commission. In this article, we will show you how to easily build an Amazon affiliate store using WordPress.

How to build an Amazon affiliate store using WordPress

Getting Started With Amazon Affiliate Store and WordPress

Amazon is the largest online store in the world. They also have an affiliate program which pays you a commission on every purchase made by a customer you referred.

You can recommend Amazon products on your existing website or create a new Amazon affiliate store to make money online.

WordPress with WooCommerce makes an excellent ecommerce platform to build your Amazon affiliate store. WooCommerce already powers millions of ecommerce websites all over the world.

To get started, you will need to be using WordPress.org platform (See WordPress.com vs WordPress.org).

You will also need a WordPress hosting account, a domain name, and an SSL certificate if you want to accept payments for other non-affiliate products on your website.

Typically, a domain name costs around $14.99 / year, web hosting costs around $7.99 / month, and SSL certificate costs around $69.99 / year.

If you are just starting out, then this is quite a lot.

Thankfully, Bluehost, an official WordPress and WooCommerce recommended hosting provider, has agreed to offer our users a free domain name, free SSL certificate, and a discount on web hosting.

Basically, you can get started for $2.75 / month.

→ Click here to Claim this Exclusive Bluehost offer �

After purchasing hosting, follow the setup instructions in our how to start an online store article. It will walk you through sign up process, and setting up WooCommerce.

Once you have installed WordPress, you can come back here and follow the instructions below to setup your Amazon affiliate store.

Signing up for Amazon Affiliate Account

Now that you have installed WordPress and WooCommerce, you will need to sign up for an Amazon affiliate program to start adding products with your affiliate ID.

Head over to Amazon Affiliate program website and click on the ‘Join now for free’ button.

Join Amazon affiliate program

Next, you’ll be asked to login with your existing Amazon account or sign up for a new account.

Login or sign up

Once you are logged in, you’ll need to provide payee information and answer questions about your website. Follow the on-screen instructions to complete your profile.

Affiliate program wizard

Upon completion, your application will be reviewed and approved by Amazon.

Adding Amazon Affiliate Products in WooCommerce

WooCommerce makes it very easy to add external affiliate products to your website. It allows you to offer a native user experience and integrate affiliate products seamlessly into your website.

To add a product go to Products » Add New page.

Adding a new affiliate product in WooCommerce

First you need to provide a title for the product you are adding and then add a detailed description in the post editor.

After that, scroll down to product data meta box and select ‘External/Affiliate Product’ under ‘Product type’ dropdown menu.

Product URL

Now you need to enter the product affiliate URL. You can get the URL from your Amazon Associates account dashboard. Simply search for the product and then click on the get link button.

Get product link

Copy the URL and paste it on your product edit page in WordPress. After that you need to add the product price. If there is a sale going on then, you can also add the sale price.

Below the product data, you can provide a short description for the product. This description will be displayed on the shop front page and in search results.

To your right, you can add a product image and product gallery images. You can find the product images from the product page on Amazon.

Product images

You can now click on the publish button to make the product go live on your website.

Repeat the process to add more affiliate products to your website. Once you have added a few products, you can go and visit the shop page on your website to see the products in action.

Shop page

Growing Your Amazon Affiliate Store

Now that you have set up your Amazon affiliate store, you can focus on growing your business.

Fortunately, there are many tools, plugins, and resources that will help you achieve those goals. You can start with SEO and optimize your store for search engines. Follow the step by step instructions in our WordPress SEO guide for beginners.

After that you can check out these useful tools and plugins for Affiliate marketing and the essential WordPress plugins for business websites.

Looking for a cool new design for your website? Check out our expert-pick of the best WordPress themes for affiliate marketers.

Above all, make sure that you are continuously adding useful products, helpful reviews, and targeted content to your website. In the end, that’s what your users are looking for and that’s what you should strive to offer them.

We hope this article helped you start an Amazon affiliate store using WordPress. You may also want to see our ultimate step by step WordPress security guide for beginners.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Build an Amazon Affiliate Store Using WordPress appeared first on WPBeginner.

Learning about the F# SAFE stack – Suave.io, Azure, Fable, Elmish

Last month I looked at a Functional Web with ASP.NET Core and F#’s Giraffe. Giraffe is F# middleware that takes ASP.NET Core’s pipeline in a new direction with a functional perspective. However, Giraffe isn’t the only F# web stack to choose from! There…

Last month I looked at a Functional Web with ASP.NET Core and F#'s Giraffe. Giraffe is F# middleware that takes ASP.NET Core's pipeline in a new direction with a functional perspective. However, Giraffe isn't the only F# web stack to choose from! There's Freya, WebSharper, and there's also a very interesting and quite complete story with The SAFE Stack.

The SAFE Stack

The SAFE Stack is an open source stack, like LAMP, or WAMP, or other acronym stacks, except this one is all open source .NET with a functional perspective. From the announcement blog:

  • Suave model for server-side web programming
  • Azure for cloud-based systems
  • Fable for Javascript-enabled applications.
  • Elmish for an easy-to-understand UI programming mode

To be clear, while this is a prescriptive stack, it's not a stack that forces you to do anything. You can swap bits out as you please.

Fable is particularly interesting as it's an F# to JavaScript transpiler. Try Fable online here http://fable.io/repl and turn F# into JavaScript LIVE! Their Sudoku sample is particularly impressive.

Here's two small - but interesting - examples where F# code ends up as JavaScript which ends up creating ReactJS components:

let words size message =
    R.span [ Style [ !!("fontSize", size |> sprintf "%dpx") ] ] [ R.str message ]
let buttonLink cssClass onClick elements = 
    R.a [ ClassName cssClass
          OnClick (fun _ -> onClick())
          OnTouchStart (fun _ -> onClick())
          Style [ !!("cursor", "pointer") ] ] elements

Then later in a Menu.fs that also turns into JavaScript eventually, you can see where they conditionally render the Button for logout, or links for for other Views for the Home Page or Wishlist. You can read lots more about Fable over at the Compositional IT blog.

let view (model:Model) dispatch =
    div [ centerStyle "row" ] [ 
          yield viewLink Home "Home"
          if model.User <> None then 
              yield viewLink Page.WishList "Wishlist"
          if model.User = None then 
              yield viewLink Login "Login" 
          else 
              yield buttonLink "logout" (fun _ -> dispatch Logout) [ str "Logout" ]
        ]

Elmish for F# takes the Model View Update (MVU) architecture and brings it to F# and the browser. There's a good breakdown of the value Elmish provides also at the Compositional IT blog.

Suave is its own cross platform Web Server. Here's Hello World in Suave.

open Suave


startWebServer defaultConfig (Successful.OK "Hello World!")

Suave has been around for while and gets better all the time. I blogged about it in 2015 and got it running on Azure. My blog post is not a best practice any more - it was a spike attempt by me - and fortunately they've moved on and improved things.

Here's Suave getting set up within the sample app. Check out how they route HTTP Verbs and URL paths.

    let serverConfig =
        { defaultConfig with
            logger = Targets.create LogLevel.Debug [|"ServerCode"; "Server" |]
            homeFolder = Some clientPath
            bindings = [ HttpBinding.create HTTP (IPAddress.Parse "0.0.0.0") port] }
    let app =
        choose [
            GET >=> choose [
                path "/" >=> Files.browseFileHome "index.html"
                pathRegex @"/(public|js|css|Images)/(.*)\.(css|png|gif|jpg|js|map)" >=> Files.browseHome
                path "/api/wishlist/" >=> WishList.getWishList loadFromDb ]
            POST >=> choose [
                path "/api/users/login" >=> Auth.login
                path "/api/wishlist/" >=> WishList.postWishList saveToDb
            ]
            NOT_FOUND "Page not found."
        ] >=> logWithLevelStructured Logging.Info logger logFormatStructured
    startWebServer serverConfig app

Very interesting stuff! There are so many options in .NET open source. I'll be doing podcasts on this stack soon.

Trying out the SAFE Stack

If you're using Visual Studio Community 2017, make sure you've got F# support included. I double-checked under Individual components. You can run the VS2017 installer multiple time and add and remove stuff without breaking things, so don't worry. If you are using other versions of VS, check here http://fsharp.org/use/windows/ to get the right download for your machine. If you're using Visual Studio Code, you'll want the Ionide F# plugin for Code.

Adding F# to Visual Studio Community 2017

Once I had node and yarn installed, it was easy to try out the sample app and get it running locally with "build run." It uses DotNetWatcher, so you can just keep it running in the background and work on your code and it'll recompile and restart as you go.

The SAFE stack running

The complete "SAFE" stack demo website is LIVE here http://fable-suave.azurewebsites.net (login test/test/) and all the source code for the app is here: https://github.com/SAFE-Stack/SAFE-BookStore.


Sponsor: Do you know how many errors, crashes and performance issues your users are experiencing? Raygun installs in minutes. Discover problems you didn't even know about and replicate bugs with greater speed and accuracy. Learn more!



© 2017 Scott Hanselman. All rights reserved.
     

24 Best WordPress Themes for Events (2017)

Are you looking for the best WordPress theme for events? Not all WordPress themes come with features and design to help you promote your event or conference. In this article, we will show you the best WordPress themes for events and conferences. Building an Event… Read More »

The post 24 Best WordPress Themes for Events (2017) appeared first on WPBeginner.

Are you looking for the best WordPress theme for events? Not all WordPress themes come with features and design to help you promote your event or conference. In this article, we will show you the best WordPress themes for events and conferences.

Best WordPress themes for events

Building an Event Website with WordPress

WordPress is the perfect tool for event managers and organizers to build their websites. It integrates with third-party platforms to sell tickets, add event calendars, live chat support, and more.

However, you need to make sure that you are choosing the right platform for your website. A self-hosted WordPress.org website gives you access to all the powerful features of WordPress (See WordPress.com vs WordPress.org).

To get started, you will need a domain name and a WordPress hosting account.

We recommend using Bluehost. They are one of the largest WordPress hosting companies, powering 2+ million websites around the world. They’re also giving our users a free domain name, free SSL certificate, and a 60% discount.

Once you have purchased hosting, the next step is to install WordPress. Follow our guide on how to make a website for step by step instructions.

Next, it’s time to pick a theme for your events website. Select a WordPress theme for events from our expert pick below.

This list includes both free and paid themes, and all of them are mobile-friendly out of the box.

1. Conference

Conference

Conference is a modern and stylish WordPress theme for events, conferences, exhibitions, and more. It comes with built-in PayPal integration to accept payments online. It also integrates beautifully with third-party tools like Eventbrite.

It features a modern layout for the homepage with sections to add speakers, sponsors, tickets, blog posts, testimonials, and more. It has unlimited color schemes, social sharing, custom widgets, and multiple layouts. A custom theme options panel is also included to help you set up your website easily.

2. Meeting

Meeting

Meeting is an ultra responsive WordPress theme for events and conferences. It features a sophisticated modern homepage layout with large fullscreen slider, event countdown timer, and call to action buttons. It has easy to manage sections to add speakers, venue, sponsors, and pricing table for tickets.

It can be used as a one-page template as well as a multi-page theme. Inside you will find tons of options for social media sharing, custom widgets, colors, and more. It also ships with a premium drag and drop page builder plugin.

3. Leader

Leader

Leader is a powerful and highly flexible all-purpose WordPress theme suitable for events, conferences, and business websites. It ships with 28+ homepage layouts, 13 header styles, 36 portfolio templates, 12 blog layouts, and more.

It comes with easy theme options panel with one-click demo importer allowing you to quickly setup your website. It ships with a page builder and a premium slider plugin.

4. OpenEvent

OpenEvent

OpenEvent is a powerful WordPress theme designed specifically for events like conferences, workshops, meetings, and more. It is designed to sell more tickets by making your event website standout. Its modern homepage layout is very easy to setup and it even comes with a front-end editor that allows you to edit your website directly from the frontpage.

It comes with 1-click event importer from Facebook event and Eventbrite. You can show who has RSVP’d on Facebook and engage your audiences on Facebook. You can easily add speakers, sponsors, testimonials, and photos and video galleries. It also integrates with several third party tools to sell tickets including WooCommerce.

5. Chakra

Chakra

Chakra is a multi-purpose WordPress theme with flexible options. It is suitable for all kind of business websites including events and conferences. It includes 12 homepage styles, 6 blog page styles, 17 page samples, and 23 reusable design elements.

It ships with slider plugin, premium page builder, full support for multilingual websites. It is WooCommerce ready so you can sell tickets from your own website.

6. Conference Pro

Conference Pro

Conference Pro is a flexible and modern WordPress theme for events and conferences. It comes with a flexible drag and drop event composer, allowing you to setup beautiful event website and custom landing pages if you need.

It includes sections to easily add event date, venue, sponsors, speakers, testimonials, and more. It integrates with all event management WordPress plugins, third-party ticketing websites, and comes with built-in social media integration to help promote your event.

7. Amore

Amore

Looking for a WordPress theme for family events like weddings, reunions, and parties? Take a look at Amore. This beautifully designed WordPress theme is perfect for such events.

It comes with beautiful fullscreen slider on the homepage with animated event countdown. You can create and use any color scheme you want. All theme options can be set up using theme customizer. It also comes with simple page builder to create your own custom layouts.

8. Speakersumo

Speakersumo

Speakersumo is designed specifically for public speakers. It allows you to showcase the events you have attended as speaker, upcoming events, and add booking form for future events.

It comes with an schedule calendar, events section with details page, presentations, custom call to action buttons for booking forms. It is easy to setup and comes with 1-click demo installer complete with content and settings.

9. Conference Theme

Conference Theme

Conference Theme is a very beautifully designed WordPress theme for events like conferences, exhibitions, workshops, and more. It has a very modern look with a stunning slider on top followed by event information like speakers, sessions, schedule, venue, sponsors and more.

It comes with gorgeous templates for speaker pages, schedule, full width page template, and separate blog pages. It works with all third-party ticketing solutions, and you can even use it with WordPress ecommerce plugins to sell your own tickets.

10. Event

Event

Are you looking for a more trendy WordPress theme for entertainment related events like concerts, clubs, music festivals? Take a look at the Event theme. This bold and modern WordPress theme is designed for music events, club launches, and other entertainment and lifestyle events.

It comes with event management, audio, video, photo galleries, and built-in social sharing. It includes an integrated drag and drop page builder, 1-click demo installer, and powerful theme customization panel.

11. Event

Event

If you are looking for a free WordPress theme for events, then Event is the theme for you. It features a stylish homepage layout which is easy to setup using the live theme customizer. It includes custom widgets, multiple sidebars, header widget area, upcoming events, and more.

It includes beautiful templates for blog posts, full-width page, large header images, and support for multilingual websites using Polylang plugin. It works with third-party event ticketing services as well as WooCommerce.

12. Flexi

Flexi

Flexi is a multipurpose WordPress theme suitable for all kind of business websites including events. It has an elegant homepage design with beautiful parallax effects and a large full width slider. It comes with multiple homepage styles, layout choices, and color schemes to choose from.

Inside you will also find sections to add team members, portfolio items, photo galleries, partners, and more. It ships with a page builder, 1-click demo installer, and easier setup instructions.

13. Keynote

Keynote

Keynote is a WordPress event theme shipped with The Core which is a bundle of multiple themes packed inside one mega theme. It includes dozens of styles, unlimited colors, powerful social sharing, unlimited page layouts, and many more options.

It comes with a built-in events management section to easily add events and display an event schedule calendar. It is easy to setup and comes with 1-click installer and an integrated page builder.

14. Just Married

Just Married

Looking for an elegant design for a wedding event? Take a look at Just Married wedding theme for WordPress. It comes with a unique design, beautiful full screen background images, a single column homepage, and gorgeous image galleries.

It is available in 4 color schemes and you can also choose your own colors. Inside you’ll also find sections to add groomsmen, bridesmaid, accommodation, reservations, contact forms, and more.

15. Minimum Pro

Minimum Pro

Minimalism often brings simplicity and allows you to create truly great designs. Mimimum Pro is a minimalist WordPress theme with spacious layouts and graceful design. It is built on Genesis theme framework and highly optimized for speed and performance. It offers a simplistic theme options panel for quicker setup.

Its homepage is made up of different widget ready areas allowing you to drag and drop content widgets to create homepage. It also includes custom page templates, customizable header and background.

16. Atomic

Atomic

Atomic is a gorgeous all-purpose WordPress business theme. Its most noticeable features are crisp typography and beautiful display of images.

It comes with beautiful templates for project items, photo galleries, lightbox popup for videos, and easy customization. All theme options are located under customizer, and it comes with a getting started guide as well.

17. Insight

Insight

Insight is a multipurpose WordPress theme suitable for content rich event websites with a magazine style layout. It comes with several custom widgets and fully widgetized homepage layout.

It is available in 3 color schemes. All theme options are easily accessible via customizer and a theme options panel. It works with all third party event ticketing plugins.

18. Oscillator

Oscillator

Oscillator is a flexible WordPress theme for music events, bands, and musicians. It comes with built-in slider, artists, discography, event management, galleries and videos.

It includes a beautiful music player that you can display site-wide. It also has a drag and drop homepage with custom widgets for content discovery, social networking, Twitter, Flickr, and more.

19. Mondree

Mondree

Mondree is a powerful WordPress themes designed specifically for events and events managers. It comes with an intuitive drag and drop event builder which acts like a page builder to create landing pages for your events.

It includes post types to easily add speakers, sessions, schedules, sponsors, testimonials, and more. You can sell your tickets using any third party platform or directly using WooCommerce. It is easier to setup with theme customizer, custom widgets, and theme settings page.

20. Highend

highend

Highend is a multipurpose WordPress theme designed for flexibility and ease of use. It ships with 16+ demo templates with drag and drop capability to quickly create any kind of website you want. It includes 1-click demo installer and a powerful theme options panel for quicker installation.

It is translation ready and comes with full WooCommerce support allowing you to sell tickets online. It also includes premium slider, page builder, and grid layout plugins to create custom page layouts of your own.

21. Vertoh

Vertoh

Designed for event professionals, Vertoh is a beautiful WordPress theme for any kind of events website. It is designed to help you sell more tickets and generate leads for your event.

It comes in 16 color schemes and 4 header styles to give your site a unique look. It includes custom post types to add speakers, sponsors, testimonials, attractions, and more. It integrates well with third party event ticketing websites and you can also use PayPal and WooCommerce to sell tickets.

22. Hestia

Hestia

If you are looking for a free and flexible option to build an event website, then check out Hestia. This free theme comes packed with premium-like features, beautiful templates, and works with page builders like Beaver Builder.

It comes with advanced settings for beautiful header styles, multiple layout choices, sidebars, and a beautiful homepage layout. It is WooCommerce ready and compatible with bbPress and all essential WordPress plugins.

23. Tyler

Tyler

Tyler is a WordPress event theme made for event professionals and organizers. Its homepage has a large image with clear call to action button with event date and venue. It comes in 15 color combinations, speaker profiles allow you to differentiate between performers.

It also includes built-in sections to add sponsors, testimonials, sessions, and more. It comes with 1-click demo installer and simpler theme setup process. It works with third-party event ticketing platforms and you can also sell tickets using WooCommerce and PayPal.

24. Creativo

Creativo

Creativo is a WordPress theme to create any kind of website with simple drag and drop tools. It comes with 11 ready-made designs that can be installed with 1-click.

It works with all popular event calendar plugins, WooCommerce, and third-party platforms like ticketing services and email marketing platforms. It is easy to setup and highly optimized for performance.

We hope this article helped you find the best WordPress themes for events. You may also want to see our ultimate step by step WordPress SEO guide for beginners.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 24 Best WordPress Themes for Events (2017) appeared first on WPBeginner.

What’s Coming in WordPress 4.9 (Features and Screenshots)

WordPress 4.9 is expected to be released on November 14th, 2017. We got our hands on the first beta version to checkout the new features and changes that are coming. In this article, we will show you what’s coming WordPress 4.9 with features and screenshots.… Read More »

The post What’s Coming in WordPress 4.9 (Features and Screenshots) appeared first on WPBeginner.

WordPress 4.9 is expected to be released on November 14th, 2017. We got our hands on the first beta version to checkout the new features and changes that are coming. In this article, we will show you what’s coming WordPress 4.9 with features and screenshots.

What's coming in WordPress 4.9

Note: You can try out the beta version on your computer or on a staging environment by using the WordPress Beta Tester plugin.

It is still under development, so some features may not make it to the final release.

Save and Schedule Theme Changes in Customizer

WordPress 4.9 will introduce saving theme customizations as draft. Now when you make changes to a theme using the customizer, you will have an option to save your changes as a draft instead of making them live.

Save theme changes as draft

This new feature will also allow you to share the preview of changes with a url. You can send this URL to any user, and they will be able to see your website with the changes made in that particular draft.

Share customize changes with URL

Want to publish your theme changes at a specific time? WordPress 4.9 will also allow you to schedule changes.

Schedule theme changes

The New Gallery Widget

WordPress 4.8 brought media widgets including rich text, audio, image, and video. WordPress 4.9 will introduce the new gallery widget.

It will allow you to create a native WordPress gallery and add it to any widget ready areas.

The new Gallery widget in WordPress 4.9

However if you want a more powerful gallery with albums, then you need to look at a third-party plugin like Envira Gallery.

Add Media Button in Text Widget

The newly introduced text widget came with visual and plain text editors. However, if you wanted to add an image, you still had to write HTML code.

WordPress 4.9 will fix this by adding the ‘Add media’ button on top of the text editor. This will allow users to easily add images inside the rich text widget.

Add media button in the text widget

Improved Code Editing Experience

WordPress 4.9 will bring a much better code editing experience. You will see an enhanced code editor while editing code in custom CSS, theme editor, or plugin editor.

This code editor comes with syntax highlighting, code suggestions, and auto-completion.

Code editing in WordPress 4.9

If you have ever faced syntax error when editing your theme, then this enhancement will automatically fix many common mistakes that cause such errors.

Error highlighting in new code edior

Don’t like syntax highlighting? It can be easily disabled from your user profile page.

Disable syntax highlighting

Miscellaneous Changes

These under the hood changes are likely to make into the final WordPress 4.9 release.

Better mapping for theme widgets and navigation menus after switching themes. #39693, #39692

Removal of SWFUpload library from the core. #41752

Recursively search for files in plugin and theme editors. #6531

We hope this article helped you learn what’s coming in WordPress 4.9. Let us know which features you find exciting and what you would like to see in future releases of WordPress?

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post What’s Coming in WordPress 4.9 (Features and Screenshots) appeared first on WPBeginner.

Free .NET Training – The Videos from .NET Conf 2017 are now available

.NET Conf 2017 is done and it was great. We had three days of sessions, and two of the days had two tracks, so there’s more than 40 hours of great free videos and training for you to check out and share. Some of the content was from Microsoft but a bun…

.NET Conf was worldwide this year.NET Conf 2017 is done and it was great. We had three days of sessions, and two of the days had two tracks, so there's more than 40 hours of great free videos and training for you to check out and share. Some of the content was from Microsoft but a bunch of the videos were from community and open source project members who Skyped into the studio! While I was in Redmond, Washington, Miguel de Icaza and Scott Hunter did a keynote from Devintersection in Stockholm.

There were also a number of local dotNetConf events! I hope you consider hosting one in your locale next year! While the virtual conference was filmed and broadcast LIVE, all the session videos are posted now at https://channel9.msdn.com/Events/dotnetConf/2017. There's 46 videos but here's a few of my favorites.

Containerized ASP.NET Core Apps with Kubernetes

Mete Atemal from Google joined us to talk about Containerized ASP.NET Core Apps with Kubernetes

image

Build Your Own Cortana Skill

Dorene Brown showed us how to wrote a Cortana skill in C# and .NET.

image

What's New in Visual Studio 2017

Kasey does a deep drive into a TON of the more advanced VS2017 features.

image

Diagnostics 101

The Legend himself, Jon Skeet, does a fantastic code-heavy talk on how to diagnose your app when things go wrong.

image

Go Serverless with Azure Functions and C#

Cecil Phillip breaks down the "serverless" buzzword and shows you how to use Azure Functions.

image

Get started with F# and .NET Core

Phillip Carter is geeked about F# and you should be too!

image

Full Stack F# with Fable

Once you've gotten started with F#, take a look at Fable and start writing Full Stack F# with F# on both the server and client!

image

Turning software into computer chips with Hastlayer

Zoltan explains to me how to use Hastlayer to transform .NET software into electronic circuits on FPGAs!

    image

    Getting Started with .NET

    And finally, last but not least, Kathleen Dollard and I did two hours (part 1 and part 2) on:

    image

    This is just a taste, there's a LOT of great videos so go explore!


    Sponsor: Do you know how many errors, crashes and performance issues your users are experiencing? Raygun installs in minutes. Discover problems you didn't even know about and replicate bugs with greater speed and accuracy. Learn more!



    © 2017 Scott Hanselman. All rights reserved.