Posted 06 July 2012 - 02:50 PM (#1)
Posted 06 July 2012 - 02:58 PM (#2)
For example, if my site is at http://example.com/, but all my assets are located at http://static.example.com/, I can set my base href to http://static.example.com/, and then call images like so:
<head>
<base href="http://static.example.com/" />
</head>
<body>
<img src='assets/images/oh-hello.png' />
<!--Actual link is http://static.example.com/assets/images/oh-hello.png-->
</body>
Posted 06 July 2012 - 02:59 PM (#3)
<a href='/my/full-path'>link</a>to ensure that my link will work even if I move it do a different "folder" (controller) I could instead set my base to:
<base href="/">but it doesn't work for images or anything else.
Posted 06 July 2012 - 02:59 PM (#4)
NeilHanlon, on 06 July 2012 - 02:58 PM, said:
For example, if my site is at http://example.com/, but all my assets are located at http://static.example.com/, I can set my base href to http://static.example.com/, and then call images like so:
<head>
<base href="http://static.example.com/" />
</head>
<body>
<img src='assets/images/oh-hello.png' />
<!--Actual link is http://static.example.com/assets/images/oh-hello.png-->
</body>
Ah ok. Thanks much.
Posted 06 July 2012 - 04:00 PM (#5)
Posted 06 July 2012 - 04:04 PM (#6)
arronhunt, on 06 July 2012 - 04:00 PM, said:
<div id="question" data-answered='false'> Variables in my markup? Logic in my templates? </div>
Posted 06 July 2012 - 07:15 PM (#7)
arronhunt, on 06 July 2012 - 04:00 PM, said:
Well this has been around for a very long time, so I'm not sure if that would serve any use.
I used the BASE href tag once before, and that was when I needed to do website-scraping. I downloaded all the HTML from another web page into my PHP script, but obviously I didn't want to download all the CSS/JS/IMG files that come along with it - so I just plug into a BASE tag to fix that up.
Posted 07 July 2012 - 04:59 AM (#8)
-----------
HTML variables would be cool! Although I don't see much point unless they could be dynamically updated (Javascript etc.).
Posted 07 July 2012 - 10:23 AM (#9)
TheMaster, on 07 July 2012 - 04:59 AM, said:
No they wouldn't! Why does a markup file need logic!
Posted 14 July 2012 - 09:09 AM (#11)
TheEmpty, on 07 July 2012 - 10:23 AM, said:
I'd normally agree with you, but the proliferation of javascript templating frameworks makes me re-question these things.
Seen this? http://angularjs.org/
Posted 14 July 2012 - 09:26 AM (#12)
markbrown4, on 14 July 2012 - 09:09 AM, said:
Seen this? http://angularjs.org/
I use Mustache, but I do that on the server side. That stuff should be done on the server side too. If your page is dynamic, you got a server that can render a template.
Posted 14 July 2012 - 09:45 AM (#13)
TheEmpty, on 14 July 2012 - 09:26 AM, said:
The times, they are a changin'
http://lea.verou.me/...do-client-side/
The client-side is where all of this kind of processing is heading, I'm not sure I agree with all of it. It's still the wild west.
But, there's no doubt a huge amount of work is being done in this area of client-side templates / frameworks.
Backbone, Ember, Knockout, Angular etc..
I've been using Backbone for a little while now, when you start using it you can see certain patterns and why things like client-side templates work. Coupled with a way to deal with models over a REST JSON API it's pretty pleasant to work with.
And the UI is much more responsive as it's all downloaded in the scripts at the start.
The only thing you need to deal with the server for are small JSON updates.
Posted 14 July 2012 - 10:12 AM (#14)






Cartoon Clouds
Mountains
Sunrise
Clouds
Green Clouds
None



















Help