wicket autolink in CSS - css

I have the following line inside a section of a panel:
.divider{
background-image: url("img/pspacer.png");
}
With the .png placed relative to the panel java/html sources
Wicket Autolink is enabled and works for other resources, such as .js and .css files.
the Url inside the CSS declaration is unmodified by Wicket and of course results in an error when requested form the browser.
java.lang.ClassNotFoundException: img
the error changes to a 404 Error if there is no collision with static resources. Yet the original problem remains, that the autolinker does not alter the reference.

Related

How to add styles to NetlifyCMS editor preview

I am in the process of integrating Netlify CMS to a Gatsby site. Right now, while editing or creating content, a preview of the content appears to the right of the screen in plain text. Is it possible to use the same styles for both the main page and the preview page so that they both look same?
I assume since the preview page gets rendered using the page template and the page template comes with its own styles, there would be no need for an extra stylesheet.
I've tried linking the stylesheets using CMS.registerPreviewStyle("link/to/my/css/file"); but nothing changes.
The developer console returns the error
Refused to apply style from 'https://my-site-name.com/admin/cms.css'
because its MIME type ('text/html')" is not a supported stylesheet
MIME type, and strict MIME checking is enabled."
However when I try to load the style sheet directly, I get a 404 error showing that it does not exist.
What you are doing is correct, just make sure that the path is right. For example, make sure that your CSS files are nested in the static folder.

TYPO3 9.5 error handling on images / resources

I successfully set up a 404 error handler in the site config:
errorCode: '404'
errorHandler: Page
errorContentSource: 't3://page?uid=8'
On a page with elements of content type text / image following happens:
When an image is not found, it tries to include the page (width and height in frontend / image tag are set with 1080x1620px) and takes a lot of space.
Before upgrade (TYPO3 8.7) it just showed the default nginx 404 page with the backend defined width and height (imageheight 130)
How could I fix that?
EDIT: That only appears when an image is really not found. The Image-Processing works well.
How is it possible that your images are not found?
TYPO3 normally does not generate an img tag if the image can not be accessed.
What HTML is generated? and where is the intended image?
I guess you have relative paths for the images, which are based on the web root path, but you use speaking urls which build pseudo folders making the relative path incorrect.
Try to use full paths:
config.absRefPrefix = /

ASP.NET MVC Page not render when specify action

I'm having the following problem in my application.
When access a view, specifying only the controller, the entire layout of the master page is rendered correctly:
Eg:
localhost:50904/Contact
But when I specify the action, the layout of the master page is not rendered:
Eg:
localhost:50904/Contact/Index
localhost:50904/Contact/Success
I checked the HTML generated in both cases, and the generated HTML is correct. What can I be doing wrong?
Possibly you have references to .css files and those references are relative. Change the references to the .css files to start with / to make them rooted to the root of the site.
Press F12 and look for any errors in the console or network tabs.
You my find that the css or js files are not loading, check the paths if you see any errors.

Unable to determine path for background image in Wicket

I creating a simple web page in Wicket 6.x, which also has a background image.
The landing page, which is localhost:8080, has the css defined in the html document as :
<style>
html,body{
background: url("bg.png");
}
</style>
bg.png is stored in src/main/webapp, and seems to work fine.
But once it goes to the next page, in which I have defined the css in the same way, the image does not show. On clicking the generated url, which is localhost:8080/wicket/bookmarkable/bg.png, the page says "resource not found".
Where do I keep my css resources and what should be the correct path? Also, is there any method or initialization I need to do in my java class file as well?
Use "/bg.png" as a path. This is context absolute path and will work no matter what is the url of the current page.

Grails GSP Resources plugin : Resource Not Found Error

I'm using the GSP Resources plugin (http://grails.org/plugin/gsp-resources) to allow me to use GSP tags inside my css files. However, I'm getting a weird error when using the "resource" tag. Here's the line causing the problem:
background: transparent url(${resource(dir: 'static/images', file: 'servererror.png')}) 0.5em 50% no-repeat;
I get the following two errors on application start up:
2014-01-21 09:39:03,608 [FileSystemWatcher: files=#248 cl=groovy.lang.GroovyClassLoader#484b2882] ERROR resource.ResourceMeta - Resource not found: /static/images/servererror.png
Error
2014-01-21 09:39:04,257 [FileSystemWatcher: files=#248 cl=groovy.lang.GroovyClassLoader#484b2882] ERROR resource.ResourceMeta - While processing /css/servererror.css, a resource was required but not found: /static/images/servererror.png
The resource is there. If I manually type in the path I can access it no problem. If I move the line causing the problem to the "html" gsp file it works. However, since Grails can't find it, it doesn't put in the path correctly in the css file.
Any help is highly appreciated.
Your best shot will be to manually type the path in the css file. The reason for the error is that, the resource is not able to process the resource tags in the css.
You can inject the css file using the Applicationresource.groovy in the conf folder.
grails-app/conf/applicationresources.groovy
modules = {
application {
resource url:'css/servererror.css'
}
}

Resources