• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

Page crashes when attaching a custom stylesheet to the active theme

General Discussion
2
2
389
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    manatech last edited by 8 Apr 2020, 21:04

    Hi. I am following the guides in this link to implement a HelloWorld package:
    https://devdocs.bagisto.com/create_package.html#how-to-create-package

    When I use the following code to add the stlesheeto to admin template everything is OK (HelloWorldServiceProvider.php):

    use Illuminate\Support\Facades\Event;
    public function boot()
    {
        Event::listen('bagisto.admin.layout.head', function($viewRenderEventManager) {
            $viewRenderEventManager->addTemplate('helloworld::helloworld.layouts.style');
        });
    }
    

    But when I change the code to use velocity temmplate the page does not load completely:

    public function boot()
    {
        Event::listen('bagisto.shop.layout.head', function($viewRenderEventManager) {
            $viewRenderEventManager->addTemplate('helloworld::helloworld.layouts.style');
        });
    }
    

    Here is my /views/helloworld/helloworld.blade.php :

    @extends('shop::layouts.master')
    @section('full-content-wrapper')
    <h1>Hello World</h1>
    @endsection
    

    I noticed that the following code causes the shop.css file to crash.

    Event::listen('bagisto.admin.layout.head', function($viewRenderEventManager) {
            $viewRenderEventManager->addTemplate('helloworld::helloworld.layouts.style');
        });
    

    when I navigate to other pages everything is OK but in case of http://localhost:8000/hello-world the rendered page tries load shop.css file from a wrong location. Actually I should get:

    <link rel="stylesheet" href="http://localhost:8000/themes/default/assets/css/shop.css">
    

    But I am getting:

    <link rel="stylesheet" href="http://localhost:8000/css/shop.css">
    
    1 Reply Last reply Reply Quote 0
    • shubhwebkul
      shubhwebkul last edited by 9 Apr 2020, 07:26

      https://github.com/bagisto/bagisto/issues/2849

      1 Reply Last reply Reply Quote 0
      1 out of 2
      • First post
        1/2
        Last post