I want to create a package in umbraco. everything is alright the only problem is if I want to include a stylesheet, specially created for my plugin, I see the error below:
The legacy umbraco.cms.businesslogic.web.StyleSheet API is no longer functional for retrieving stylesheets based on an integer ID. Stylesheets are no longer persisted in database tables. Use the new Umbraco.Core.Services.IFileSystem APIs instead of working with Umbraco stylesheets.
How are you trying to add / access the stylesheet can you share an example? What kind of plugin are you making?
Adding the stylesheet using a package.manifest file in your package folder under /App_Plugins/YourPlugin should be enough to have the stylesheet loaded.
So if we use the example referenced that would look like this
{
//you can define multiple editors
propertyEditors: [
{
/*this must be a unique alias*/
alias: "My.MarkdownEditor",
/*the name*/
name: "My markdown editor",
/*the icon*/
icon: "icon-code",
/*grouping for "Select editor" dialog*/
group: "Rich Content",
/*the HTML file we will load for the editor*/
editor: {
view: "~/App_Plugins/MarkDownEditor/markdowneditor.html"
}
}
]
,
//array of files we want to inject into the application on app_start
javascript: [
'~/App_Plugins/MarkDownEditor/markdowneditor.controller.js'
],
css: [
'~/App_Plugins/YourPluginFolder/your.css'
]
}
But since I don't know what kind of plugin you're making and how you're making it you maybe don't need to setup the entire manifest but can perhaps simply just have this in your package.manifest file
So in the /App_Plugins you should place a folder with the name of your plugin and inside it place a package.manifest file with the CSS reference and you should then also place the referenced css file in this folder too.
Creating package, plugin and stylesheet
I want to create a package in umbraco. everything is alright the only problem is if I want to include a stylesheet, specially created for my plugin, I see the error below:
The legacy umbraco.cms.businesslogic.web.StyleSheet API is no longer functional for retrieving stylesheets based on an integer ID. Stylesheets are no longer persisted in database tables. Use the new Umbraco.Core.Services.IFileSystem APIs instead of working with Umbraco stylesheets.
I use umbraco v 7.4.3
Hi Mehrdad
How are you trying to add / access the stylesheet can you share an example? What kind of plugin are you making?
Adding the stylesheet using a package.manifest file in your package folder under /App_Plugins/YourPlugin should be enough to have the stylesheet loaded.
Please see https://our.umbraco.org/documentation/Tutorials/Creating-a-Property-Editor/
As with the javascript injection you can add a CSS file as well by adding
So if we use the example referenced that would look like this
But since I don't know what kind of plugin you're making and how you're making it you maybe don't need to setup the entire manifest but can perhaps simply just have this in your package.manifest file
So in the /App_Plugins you should place a folder with the name of your plugin and inside it place a package.manifest file with the CSS reference and you should then also place the referenced css file in this folder too.
I hope this makes sense :)
/Jan
is working on a reply...