Comments (5)
Try setting the prefix to something absolute like '/css/style', then set up your routing so it ignores anything in '/css/'.
from skel.
Hi n33,
Thank you for your suggestion I've been experimenting with this but unfortunately not having much luck :(
I've been using absolute paths e.g. /css/style, ../../css/style. But I either lose the styling on the landing page once published or on the {controller}/{action} pages. If I use the first absolute path example above, the landing page works fine, but any navigation to another controller, once published to IIS looks in the controller/action virtual folder like so http://servername/applicationname/controller/action/css/style.css rather than http://servername/applicationname/css/style.css. For the other example above the landing page breaks as instead of serving http://servername/applicationname/css/style.css it instead serves http://servername/css/style.css
I've tried using the ignore route as you suggested routes.IgnoreRoute("{whatevercontrollername}/{whateveractionname}/"), but no luck there either unless I'm using it incorrectly?
Any help would be greatly appreciated!
from skel.
Odd. That doesn't make a whole lot of sense. When you set a prefix in
skelJS, say:
prefix: '/css/style'
It's equivalent to prefixing every stylesheet the client looks for
with /css/style, ie.
In other words, it's purely client side. If that's not working,
something on the server side might be screwing with your configuration
(like remapping anything that looks like a route).
On 11/21/2013 8:36 AM, brandonam wrote:
Hi n33,
Thank you for your suggestion I've been experimenting with this but unfortunately not having much luck :(
I've been using absolute paths e.g. /css/style, ../../css/style. But I either lose the styling on the landing page once published or on the {controller}/{action} pages. If I use the first absolute path example above, the landing page works fine, but any navigation to another controller, once published to IIS looks in the controller/action virtual folder like so http://servername/applicationname/controller/action/css/style.css rather than http://servername/applicationname/css/style.css. For the other example above the landing page breaks as instead of serving http://servername/applicationname/css/style.css it instead serves http://servername/css/style.css
I've tried using the ignore route as you suggested routes.IgnoreRoute("{whatevercontrollername}/{whateveractionname}/"), but no luck there either unless I'm using it incorrectly?
Any help would be greatly appreciated!
Reply to this email directly or view it on GitHub:
#21 (comment)
from skel.
I do agree it definitely is something to do with the way IIS does the routing with the virtual path, I just cant figure out what or why it does it that way. I've found a sloppy hack in the mean time
function getRootWebSitePath()
{
var location = document.location.toString();
var applicationNameIndex = location.indexOf('/', location.indexOf('://') + 3);
var applicationName = location.substring(0, applicationNameIndex) + '/';
var webFolderIndex = location.indexOf('/', location.indexOf(applicationName) + applicationName.length);
var webFolderFullPath = location.substring(0, webFolderIndex);
return webFolderFullPath;
}
var rootDir = getRootWebSitePath();
and then appending rootDir to the prefix like so "prefix: rootDir + '/css/style'" this at least works when deployed live, while working locally I have to use ../../css/style as that's the only way the css will load across all views.
from skel.
A pity, but at least it works. Still, I find it unusual IIS would mangle paths in this manner (particularly absolute ones, as that's bound to break stuff elsewhere).
from skel.
Related Issues (20)
- Skel and Wordpress HOT 3
- Skel 1.0:( HOT 1
- Cannot get css file
- Typo in scss
- request info
- Conditionals
- Cannot read property 'grid' of undefined in skel-layout HOT 3
- skel menu nav dont work on iphone 6
- Proper docs? HOT 6
- Sending email HOT 2
- Is it possible to set row height in Grid Layout?
- once deployed, click on link does not work
- https:// HOT 1
- grid offsets not working for some reason HOT 2
- Using Skel in a template
- Articles display before scroll is finished.
- Prioritizing a cell not working for small
- skel deprecetaed
- Skel-panels documentation
- request for ideas: modify collapsed menus in skel-layers.js
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skel.