Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for blade layout extends and section directives #9

Open
godismyjudge95 opened this issue May 21, 2021 · 5 comments
Open
Labels
enhancement New feature or request

Comments

@godismyjudge95
Copy link

Hey if you could add support for the extends and section blade directives that would be much appreciated.
See docs here: https://laravel.com/docs/8.x/blade#extending-a-layout

Thanks for such a great extension!

@godismyjudge95
Copy link
Author

My apologies, I noticed the extends directive works if there is no space between.
For example, this does not work:

@extends ('backend.layouts.app')

But this does:

@extends('backend.layouts.app')

However, the section directives do not work at all:

@section('after-styles')

@gauravmak gauravmak added the enhancement New feature or request label May 22, 2021
@gauravmak
Copy link
Member

Little busy these days but I will surely work on this.

@gauravmak
Copy link
Member

@godismyjudge95 Please update to v1.11.1 and the links should work even if there is a space after @extends or @include

The @section think looks challenging. How do you want the links to work? We are not referring to any specific file there, right?

@godismyjudge95
Copy link
Author

@gauravmak sorry it took me so long to get back with you, it appears that the latest version v1.11.3 is not working at all with any of the blade directives. It works fine for the view helper in the controller though.

The @section directive linking would work similarly to @extends in that it would link to whatever file is being extended but scroll to the @yield directive in the layout file. Sorry, I am not explaining this well.

An example would be if a file has @extends('backend.layouts.app') and then has @section('after-styles') somewhere in the same file, clicking on the @section would send you to the same file as the @extend (backend.layouts.app) but it would also scroll you to the @yield('after-styles') directive in that file.

Hope this makes sense. Thanks for working on these - I realize we are all pretty busy ;)
Sidenote: I would love to help out with these features, but this plugin doesn't appear to be open source.

@gauravmak
Copy link
Member

Thanks for the details buddy.

it appears that the latest version v1.11.3 is not working at all with any of the blade directives.

After changing the computer, packaging the new version wasn't just working. I was facing The specified icon 'extension/images/logo.png' wasn't found in the extension. and because of that I had to manually upload the package file via the website (instead of using the vsce tool) And I am still facing the same issue even today. Even the extension page is not showing the readme details but I just can't anything here.

An example would be if a file has @extends('backend.layouts.app') and then has @section('after-styles') somewhere in the same file, clicking on the @section would send you to the same file as the @extend (backend.layouts.app) but it would also scroll you to the @yield('after-styles') directive in that file.

Makes sense but is hard to implement. We have to read files and get data. Not something which is done in this package yet.

Sidenote: I would love to help out with these features, but this plugin doesn't appear to be open source.

Yeah, if this isn't fixed, I will work towards making it open so that you can contribute.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants