Cannot import the CSS in JSF pages - jsf-2

I'm learning to use ADF on Oracle jDeveloper 11g.
I created an ADF Fusion Web Application (with the WebLogic webserver) and I created a JSF page under \ViewController\public_html. Then I created a CSS skin file (for JSF) and I put it under \ViewController\WebContent\resources\css\
I want to apply such style rules to the JSF page. To do this I put it into such page the line
<h:outputStylesheet library="css" name="prova.css" id="CASD"/>
where prova.css is the name of the CSS file I've created.
It doesn't work, neither using /css instead of css or /resources/css, etc.

Try using <af:resource type="css" source="your source path here" /> instead.

You shoud make a skin and add your page. When you make a skin
the name of skin is set in trinidad-config.xml in your project:
<skin-family>skin2(name of skin)</skin-family>

Related

How to add an image to be used in the customized css file - Swagger UI - Swashbuckle

I'm using Swagger(Swashbuckle) as the documentation tool for our Web API project. I'm able to customize index.html using customized css file.
Everything's works great, except, I want to add our company's specific logo in the index page & I couldn't get it to work.
Suggestions ??
I realize this is an older question, but I just ran into this today. If you want to embed an image file, you can do it similar to how you do for the css and index file.
Add a line in the SwaggerConfig like the following:
c.CustomAsset("mylogo", thisAssembly, "YourWebApiProject.SwaggerExtensions.mylogo.png");
You can then reference that file either in your modified css or custom index page by using <img src="mylogo" /> in your modified html or url(../mylogo) for the path if using it in your custom css file.
Similar to your index and css files, make sure it's set as an embedded resource.
What about including this in your CSS:
.swagger-section #header a#logo {
background-image: url(path/to/my/logo);
}

Layout page and simple mvc razor view in Orchard Module and css, js reference issue

According to the answer provided by REMESQ on this question: Is it possible to use razor layouts with Orchard CMS and bypass the theming
I was able to have separate layout and pages for a module bypassing Orchard's themes and layouts. But having problem referencing the cs,js script files (located in different folders of the module). Getting 404 NotFound error.
I tried referancing in the following way:
#Script.Include("~/Scripts/jquery-1.9.1.js")
But cant get the correct reference path rendered attached picture
Your URL is wrong - it should be either:
jquery-1.9.1.js. Without leading tilde and Scripts/. Orchard will make sure the final URL will lead to /Scripts folder in your current module, or
~/Modules/Your.Module/Scripts/jquery-1.9.1.js
it works if written in this way:
<link href="~/Modules/ModuleName/Styles/site.css" rel="stylesheet" type="text/css" />
For the image tags in html we can write like this:
<img alt="" src="~/Modules/ModuleName/Styles/images/for-rent.jpg" />

tinymce mcImageManager Configuration

We have configured NFS (Network File Share) and created a Virtual Directory Link to NFS in the ASP.NET MVC Website. <br>
Here is the configuration.
\172.0.0.1\Webs\Images is Network File Share (from UNIX)
"https://www.testsite.com/Images" - Virtual Directory Link to NFS
When we try to Insert an Image from tinymce editor, the MCImageManager does not show any images and it says "File/Folder was not found". Are there any other settings/permissions we are missing?
Another question,
Can we use MCImageManager on load balanced configuration? Our ASP.NET MVC site is load balanced and configured to use SQL Session State. Does it create any problem ?
Thanks in advance for your help.
This answer is probably too late for you, but since I just went through a slightly different exercise - I am using a folder outside of the website root, not a NFS.
So if you are storing images in a folder configured like this:
<!-- General file system options -->
...
<add key="filesystem.rootpath" value="C:/temp/Upload" />
...
and you configure the preview section like this:
<!-- Preview options -->
...
<add key="preview.wwwroot" value="C:/temp/Upload" />
<add key="preview.urlprefix" value="{proto}://{host}/ExternalImage/" />
...
And an image like this C:/temp/Upload/anawesomepic.jpg is going to be served at {proto}://{host}/ExternalImage/anawesomepic.jpg
TinyMCE then uses preview URL when inserting the image in edited document.
If you look at ImageManager source code in ImageManagerPlugin.cs you will see that at one point in OnCustomInfo method it calls this line:
info["thumbnail_url"] = man.ConvertPathToURI(thumbFile.AbsolutePath);
ConvertPathToURI is where the plugin removes the prefix defined in preview.wwwroot config item. Then ImageManager prepends that with preview.urlprefix, probably somewhere in javascript.
In my case I have an HttpHandler that handles images in ExternalImage, so the setup is definitely not quite like yours but maybe it helps.

Asp MVC 3: Dynamically resolve relative resources in views

I have a javascript application that runs in a view (index.cshtml).
Problem:
The problem is all relative paths are relative to the current url, which would be ok in a simple html webapp but not in asp mvc. The js-app shouldn't have to bother whether it's served in a normal html file or via a asp mvc page.
I.e. http://www.domain.com/<controller>/<action>/ contains a script test.js. This script loads an external xml file searching relative to it ie. "data/data.xml". The resulting url reads http://www.domain.com/<controller>/<action>/data/data.xml. This isn't found.
Question:
Is there a way to route static files (images,..., maybe even js files) to the content folder like "~/Content/controller/action/<pathToFile>/"?
Any help appreciated!
Lg
warappa
PS: I know about Url.Content() but that doesn't fit here.
The solution doesn't require mapping - just a simple html tag in the header:
<base href="#(Request.Url.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped) +
Url.Content("~/content/controller/action/"))" />
Lg
warappa
EDIT
Some browsers need an absolute url - sample updated.
In you can use absolute URL addresses to access you static resources:
$('img').attr('src', '/Content/Pictures/picture1.png');
or
<script src="/Scripts/script.js"></script>
This way you will allways get the same resources relative to the page base address, no matter if you load the script in a /{Controller}/{Action}/{View}, {Area}/{Controller}/{Action}/{View}, a custom route or even in a static script html page.
Or perhaps what you're looking for is the use of css files, since CSS's url('<path>') resolves the addresses relative to the CSS file's location. You would just need to import the one CSS file that had all the resource (image?) file paths. Then the scripts could reference the distinct class names, thus not being location aware at all. This is what libraries like jQuery UI do. But again this would require a fixed folder structure relative to the CSS document.

In MVC view page javascript file url not resolving

I have one MVC view page in which I show different links and I am using ThickBox to show a different page when ever one of these links is clicked. In these pages, I am using jQuery functions to do some changes, but I am not able to resolve the jquery file path on the view pages. I need to give absolute path something like "http://test.com/js/jquery.js". But is there any way to make it relative?
I also tried getting the host url and using <%=%> and <%# %> but none is working.
Any help?
Thanks
Ashwani
This is when you run the MVC app from visual studio? If so set you're MVC application's virtual path to start at "/" instead of the default that is probably your project name.
This can be done by right-clicking on the MVC project in the solution explorer > Click Properties > Click the Web tab > Type "/" (without the quotes) in the Virtual path textbox. Then use Andrew Florko's suggestion of leading it with a slash <script src="/js/jquery.js"> </script>
alt text http://img707.imageshack.us/img707/3765/virtualpath.jpg
What about trying something like:
<script src="<%=Url.Content("~/js/jquery.js")%>" type="text/javascript"></script>
Maybe you should try
<script src="/js/jquery.js" ...
instead of intellisence-generated path with ".."
<script src="../../js/jquery.js" ...

Resources