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

tag helper <style asp-name""> not work in my module #16036

Closed
MRSheikh opened this issue May 12, 2024 Discussed in #16031 · 2 comments
Closed

tag helper <style asp-name""> not work in my module #16036

MRSheikh opened this issue May 12, 2024 Discussed in #16031 · 2 comments

Comments

@MRSheikh
Copy link

Discussed in #16031

Originally posted by MRSheikh May 11, 2024
hi.
I use Orchardcore without cms "OrchardCore.Application.Mvc.Targets" to my projects and add my module to it.
I know to add
builder.Services.AddOrchardCore().ConfigureServices(s => { s.AddResourceManagement(); s.AddTagHelpers<LinkTagHelper>(); s.AddTagHelpers<MetaTagHelper>(); s.AddTagHelpers<ResourcesTagHelper>(); s.AddTagHelpers<ScriptTagHelper>(); s.AddTagHelpers<StyleTagHelper>(); });
in my program and then implement ResourceManifest.cs for my module too.
after that in _ViewImports.cshtml add
@addTagHelper *, OrchardCore.DisplayManagement @addTagHelper *, OrchardCore.ResourceManagement

and in _ViewStart.cshtml use tag helpers like this:

<style asp-name="bootstrap"></style><style asp-name="site"></style><script asp-name="myjquery"></script><script asp-name="bootstrap"></script><script asp-name="site"></script>

all scripts were added successfully into my module but nothing for styles????

what should I do to import my module styles to tag helper?

@MikeAlhayek
Copy link
Member

Make sure you add reference to OrchardCore.DisplayManagement on your module. Also make sure that your module is different that your web project. so have a web project where you add builder.Services.AddOrchardCore().... then add a module project for your module where you can reference OrchardCore.DisplayManagement

@Piedone
Copy link
Member

Piedone commented May 13, 2024

Duplicate of the #16031 discussion. Please open either a discussion or an issue, but not both. For questions, only open a discussion.

@Piedone Piedone closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants