JMD TECHI » Blog Archives

Tag Archives: laravel blade

Wordpress to laravel

Convert wordpress theme to laravel blade using this simple tips

Published by:

wordpress theme to laravel blade

Laravel is a back-end structure, yet most web-projects still require a front-end topic. Furthermore, there are no locales with “Laravel themes”, all front-end themes are generally in light of WordPress CMS. Be that as it may, it shouldn’t be an issue – we can without much of a stretch change a WP subject to Laravel Blade. We regularly do that for our customers, so I will demonstrate to you a basic illustration.

If you are looking for laravel development, we provide best laravel development service at affordable process. Visit for more info about our services.

Stage 1. Discover open demo and analyze source

To change over WordPress subject into Blade, we really needn’t bother with the WordPress version – we require HTML/CSS/JavaScript documents and different resources. We simply need our undertaking to resemble the official demo version, correct?

What’s more, coincidentally, it’s the most concerning issue of WordPress themes – buy/download takes minutes, yet influencing it to look precisely like in demo version is frequently an immense work of various hours, moreover introducing an arrangement of modules.

So my tip for you – in the event that you are endeavoring to change over WordPress themes to Laravel (or to some other framework), you ought to do it from demo version straightforwardly, without introducing real WordPress subject.

Stage 2. Fresh Laravel and courses

Subsequent stage – introduce fresh Laravel, similar to this:

composer create-project laravel/laravel –prefer-dist .

Presently, we should make another course for our Parallax One landing page:

Route::get(‘/’, ‘LandingController@landing’);

And app/Http/Controllers/LandingController.php will look like this:

class LandingController extends Controller
{

public function landing()
{
return view(‘landing’);
}

}

Following stage – make resources/views/landing.blade.php. What we do here is simply duplicate glue all the designed HTML into this document:

code

Notice: For the motivation behind this demo, I will utilize every one of the benefits from the first CDN of the topic, however in genuine case situation you ought to download/buy them and allude nearby documents.

In this way, how about we refresh our landing page and we see this:

Awesome, so we have a Laravel landing page! Presently, subsequent stage – isolate the point of arrival into areas.

Stage 3. Laravel Blade structure with ace layout

Laravel Blade accompanies very great layout structure usefulness – you can characterize ace format and broaden picked areas specifically pages.

For our landing page we will have three areas:

  • Header (always static)
  • Main part (changing from page to page)
  • Footer (always static)

In this way, we need one “ace” layout with hard-coded header and footer, and one fundamental segment as a variable.

Here’s our new resources/views/app.blade.php:

[…]

[…]

[…]
@yield(‘content’)
[…]

I’ve skirted the “immaterial” parts – entirely’s gigantic measure of HTML there, yet I need you to comprehend the fundamental structure of this document.

While hardcoding header and footer, we’re opening a @yield(‘content’) probability to infuse the substance into the center.

So our resources/sees/landing.blade.php transforms into this:

@extends(‘app’)

@section(‘content’)

[…]

@endsection

Once more, primary “compartment” has huge amounts of HTML code inside, yet don’t have any desire to overpower you.

The general point here is that in the wake of separating our code into app.blade.php and landing.blade.php, we should see totally same come about in the wake of reloading the program.