I am trying to follow the example at this link enter link description here
My library structure is such:
epimss-polymer
-lib
-src
-registration
-personnel
+credentials-form.html
I have tried many variations of
<link rel="import" href="packages/epimss-polymer/registration/personnel/credentials-form.html">
but none works.
What is the correct way to access these .html files? For .dart files, my application works fine.
Thanks
You shouldn't use - for package names.
You forgot the src directory.
Only the lib part can be omitted.
<link rel="import" href="packages/epimss_polymer/registration/src/personnel/credentials-form.html">
(I changed the - to _)
I guess nobody saw you question earlier because you haven't added the dart tag.
Related
I was trying to run the Connected List example on this page:
jQuery UI #Connected Lists
But when I copy the html and the style.css file into a local
directory and open up the html, I don't get the highlight color and border as seen in the picture
What I get from the URL
What I get when run locally
In the html code, the first column has the class "ui-state-default" and the second column is "ui-state-highlight"
The drag-and-drop functionality is still all there, just not the styling.
Is there some initialization of the demo environment that isn't included in the supplied code?
The answer lay in the reference to the jQuery .css file given here:
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
The problem is the reference starting with the double //. I got it to work by adding https: before the double quotes, or copying it locally and removing the //. The problem is the // does not correctly interpret the file:// access. It is discussed here: Browser support for URLs beginning with double slash see the answer from #Matas Vaitkevicius
I want to create a custom polymer element that incorporates custom elements from a third party library. My customelement.html file has this in the head section
<head>
<title>orderlist</title>
<link rel="import" href="packages/widget/components/accordion.html">
<link rel="import" href="packages/widget/components/collapse.html">
</head>
All is well, the editor can find the referenced components.
At runtime, however, Dartium complains that the components can't be found:
http://(mylocalhost)/birdweb_web/web/packages/birdweb/packages/widget/components/accordion.html 404 (Not Found)
From the URL it appears that Dart wants to find the custom elements in my application's library instead of in the top level packages directory.
How do I use third party polymer elements in my custom element?
That is a known bug (filed) a few days ago
Issue 13684
I have made my own stylesheet that I require to include on the Jenkins plugin.
<l:layout css="/plugin/myPlugin/css/jquery-ui.css">
<link rel="stylesheet" href="${rootURL}/plugin/myPlugin/jquery-ui.css" type="text/css" media="screen" />
Please advice me..
Thanks..
To link CSS files in Jelly files is deprecated, see jelly tags documentation:
This was originally added to allow plugins to load their stylesheets, but the use of thie
attribute is discouraged now. plugins should now do so by inserting <style> elements
and/or <script> elements in <l:header/> tag.
Please use inline css tags instead (code example).
Place your css file(s) under
/src/webapp/css
and reference them as ..
" href="${rootURL}/plugin//css/layout.css"
Using a <link> element with the $rootURL as noted above worked for me. The important thing that I noticed was to make sure to place the <link> element after <l:layout>. I had it right after the <j:jelly> tag originally and it wasn't able to render the ${rootURL}.
The <link> tag will be much cleaner than doing inline styling.
I have a folder for all my css in my main folder called "main." In "main" I have another folder called "math." I would like to use my css in the "math" folder, but when I type:
<link rel="stylesheet" href="css/basic.css" type="text/css" media="screen" />
on the index.html of the "math" folder it doenst work. I think it's because it's looking for the css folder inside of the math folder. How can i link to the css folder, which is not in the math folder?
If I am understanding, your directory structure is as follows:
siteroot
main
math
css
You are looking to link to a style sheet in /main/css from /main/math/index.html.
There are two solutions, the easiest is to use an absolute path:
<link rel="stylesheet" href="/main/css/basic.css" type="text/css" media="screen" />
Absolute paths are a better solution and will cause less headache down the road. I do not know of any drawbacks, either.
Alternatively, you could use '..' to traverse up a directory
<link rel="stylesheet" href="../css/basic.css" type="text/css" media="screen" />
For example your directory is like this:
Desktop >
ProjectFolder >
index.html
css >
style.css
images >
img.png
You are at your style.css and you want to use img.png as a background-image, use this:
url("../images/img.png")
Works for me!
Use absolute path:
href="/main/css/..."
You must go up to the same directory as css and math using ../
So it would look like ../css/basic.css
If you Want To locate a file inside of that folder use this
<link rel="stylesheet" href="./css/basic.css" type="text/css" media="screen" />
and if you want to locate a file outside of that folder you could use this snippet
<link rel="stylesheet" href="../css/basic.css" type="text/css" media="screen" />
The answer also has some dependency on whether or not the site is being developed and tested locally or if your publishing your content to a web server and testing links on the Live Site.
If your href attribute's URL is using a Relative URL and has a domain name being mapped to your Document Root on a Live Site, the above answers are correct.
However, if your testing your links where all the files are on a local PC's file system where no web server is being used locally, then you might find the following information helpful too.
If you are testing locally, there is usually no domain associated with your Document Root and the pathing changes in a number of ways.
If you link to a file in any child directories, you will NOT have an initial slash ("/") in your href or in this case a src attribute because there is no domain and the Relative URL is relative to the current page. (The same rules apply to your href URLs as well)
Local testing URLS:
<img src="images/image-1.jpg" alt="my-Image-1">
..as opposed to a Relative URL on a page in a Live Site that has a domain name where you WOULD use an initial forward slash because it will be relative to the domain.
Remote Live Testing:
<img src="/images/image-1.jpg" alt="my-Image-1">
I am aware this is not the situation you ask about but it should help with the following two examples where the folders are adjacent and parent directories on a local file system. Your situation is that your Relative URL is to a file located in an adjacent directory. See below if your developing and testing locally.
For Relative URLs linking to your css stylesheet files in an adjacent directory or even links to files a parent directory above your current page on a local filesystem (usually without a domain), your href attribute URL pathing should use a double-dot-slash (../). So your situation (if testing locally without a domain) is:
<link rel="stylesheet" href="../css/basic.css" type="text/css" media="screen" />
...as indicated by #Cory Dolphin above.
I experienced this and found that my issue was that I kept finding different results depending on where I was testing and it was driving me mad.
I originally thought the pathing difference had to do with my local files being on my local Windows system and the reason it was slightly different was becuase of the file system of my remote Linux Apache VPS.
I found that it has more to do with whether it has a domain mapping to your site files or not. This is addressed somewhat in W3Schools.com's Page in the section that's titled The src Attribute and Relative URLs.
in the cover page (login, register...) of my app i have this line:
<link rel="stylesheet" type="text/css" href="/css/formularios.css">
When i deploy my app, the that css rule is not loaded because, as i can
see in Firebug, it's looking for that rules in
www.tirengarfio.com/css/formularios.css instead of
www.tiregarfio.com/rs2/web/css/formularios.css.
What should i do?
Javi
You should use the view.yml config file and the include_stylesheets() helper. However, if you'd like to create the link tags by hand, use the public_path() helper to get the correct path.