English 中文(简体)
inline markup / templating engine for customer facing CMS
原标题:

There are many hosted CMS applications that provide you with some sort of inline markup/ templating engine that lets you output things into a page.

for example, a hosted cms application lets you edit your templates to custome html/css, but they also let you do some basic inline code on the page to do this like inject the article title, date, etc. (object properties) and let you loop through predefined collections.

How do they do this?

How do they prevent the user from accessing other objects which you don t want them to?

e.g. Imaine them outputing your connection string! lol

here is an example: http://wiki.shopify.com/UsingLiquid

问题回答

Typically the safest way is to create a self-contained scripting language - a runtime within the runtime that has a very limited scope of builtin objects populated by the host runtime, and none of which are dangerous. Obviously a script executing in a runtime cannot reach up outside it s own universe unless the runtime itself provides a mechanism to do so.





相关问题
What does it mean "to write a web service"?

I just asked a question about whether it was possible to write a web-page-checking code and run it from free web server, and one supporter answered and said that it was possible only if I run "a web ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Dynamically building a command in bash

I am construcing a command in bash dynamically. This works fine: COMMAND="java myclass" ${COMMAND} Now I want to dynamically construct a command that redirectes the output: LOG=">> myfile.log ...

Why does Scala create a ~/tmp directory when I run a script?

When I execute a Scala script from the command line, a directory named "tmp" is created in my home directory. It is always empty, so I simply deleted it without any apparent problem. Of course, when I ...

Ivy, ant and start scripts

I have a project that uses ant to build and ivy for dependencies. I would like to generate the start scripts for my project, with the classpath, based on the dependencies configured in Ivy, ...

热门标签