In smarty is it possible or is there any kind of function to render a template and return the result?
for example:
$rendered_content = $smarty->render("content.html")
Hello. I've got a new project, and currently I'm trying to set it correctly. But somehow I can't make my media files work. Here's my current setting :
MEDIA_ROOT = os.path.normpath( '/home/budzyk/rails/fandrive/site_media/' )
templates setting work on the other hand :
TEMPLATE_DIRS = (
"/home/budzyk/rails/fandrive/templates",
)
Catalog with media files is ../fandrive/site-media/ so why it's not working ? Here's my base.html template with styles imported, and firebug window when my page is loaded :
<head>
<title>{% block title %}{% endblock %}</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/style.css" />
{% block pagecss %}{% endblock %}
<script type="text/javascript" src="{{ MEDIA_URL }}jquery/jquery-1.4.2.min.js"></script>
</head>
<body>
<div id="wrapper">
http://img237.imageshack.us/img237/4909/21205809.jpg
Here's my code. It compiles in VS2005 but not in gcc. Any ideas
template<class T>
Derived<T>::Derived(const Derived<T>& in)
{
Base<T>::Base<T>(in); //ERROR here
}
"expected primary-expression before token"
For many questions, especially for C-related ones, the answer seems to be found in "the standard". However, where do we find that - online?
Googling can sometimes feel futile, again especially for the C standards, since they are drowned in the flood of discussions on programming forums ;)
To get this started, since these are the ones I am searching for right now, where are there good online resources for:
C89
C99
C++03
the following is the code. but it doesn't work. what's wrong with it? thank you.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>no title</title>
<script type="text/javascript">
function copyToClipBoard(content){
var clipBoardContent = '';
clipBoardContent = content;
window.clipboardData.setData("Text",clipBoardContent);
alert('have copied to the clipboard');
}
<body>
<textarea rows="4" cols="60" id="url">www.example.com</textarea>
<input type="button" value="click me" onclick="copyToClibBoard (document.getElementById ('url').value);" />
</body>
Say I'm using a form with a text-field.
<@s.form action="login"
<@s.textfield label="E-mail" name="email"/
<@s.submit value="send"/
How can I specify that the text-form should be generated by a custom template (text_login.ftl) rather than the standard text.ftl?
I have something of a a hairy problem, I'd like to generate a couple of paragraphs of "description" of a given url, normally the start of an article. The Meta description field is one way to go but it isn't always good or set properly.
It's fair to say it's a bit problematic to accomplish this from the screenscraped HTML. I had a general idea that perhaps one could scan the HTML for the first "appropriate" segment but it's hard to say what that is, perhaps something like the first paragraph containing a certain amount of text...
Anyone have any good ideas? :) It doesn't have to be foolproof
I have a UIWebView inside a normal UIViewController. The content of the UIWebView is programming/dynamically created in my program, and it could be very long (multiple table rows). Somehow, after loading, the page won't scroll more then one and half screen of content when swipe on the screen. Because of that I can only see the beginning few rows of data, but not the many others after them. Why is that?
I'm trying to figure out if
g++ -fsyntax-only
does only syntax checking or if it expands templates too.
Thus, I ask stack overflow for help:
is there to write a program so that syntactically it's valid, but when template expansion is done, an error occurs?
Thanks!
What is the most painful programming mistake you have done and what lesson you have learn after?
I guess mine was making a release to production on the development code which was not tested yet.
The lesson-learned:
Delete any projects that can trigger a
release on the live application from
CCTray. I only add them when a release
to production is necessary since then.
And once I am done, I delete them from
my project lists.
I'm working in VS2008 and C#, and I'm looking for a (free) code generator tool to generate a property with getter and setter, as well as the backing private field to go with. The template thingy in VS does not make the field to go with it. Just looking for something a little bit better.
I once saw a web site where you could build this code, then cust-and-paste it from the web page to your code.
I have couple of copyright videos available on my S3 buckets. I want to stream them on my website, but at the same time. I don't want the users to rip the video from the video player.
I tried to google about it but still i am not confident on this, coz i do not know the intricacies of
options available like
Server Side encryption None/ AES-256
2) A very interesting option is under Metadata tab - It shows couple of keys & Values. How can i use them to secure my video content?
3) Add more meta data and related options?
I am looking to get into web application development. I am an undergrad CS major with experience in programming desktop apps, but with only basic knowledge regarding how web apps work. Any suggestions of where to start? Javascript, php, perl, ruby, python? Should I look into frameworks like django, seaside, ruby on rails, etc at first or wait until I am more experienced to use those?
I wrote a program to compile a simple text program to a compiled executable... Is it possible that I can load an executable to memory an some how point a pc counter to the memory space at will?
Here is what I made that I would like to store the programs to memory for execution on demand... Kind of wanting to make a little web language like php but compile it... Just for learning.
http://spiceycurry.blogspot.com/2010/05/simple-compilable-programming-language.html
I am a beginner in Android programming. I want to build a simple application with a main list view in the screen and two buttons at the bottom of the screen.
When more items are added to the list view, the list view should scroll without increasing the overall length of the list view.
I'm writing an interface spec in MS Word and it would be great if there were some sort of template or pluggin for Word (2003 here) that would make it all look a bit prettier.
(I'm realizing how spoiled I am with even the archaic VB6 IDE).
I am running a store on Magento. For some reason the "Recently Viewed", "Related Items" and "Featured Items" blocks have all disappeared from my site. They where definitely there yesterday so I'm not sure what's happened to them.
Featured Products is an extension I use and show on the home page using:
{{block type="featuredproducts/listing" template="inchoo/block_featured_products_main.phtml"}}
Does anyone have any idea what the problem could be?
Can you?
I downloaded C# express and Web Developer Express but neither have the templates that all of the walkthroughs start from.
Is there any way I can get the template or do I HAVE to get the professional version.
I'm reading this article about Comet http://en.wikipedia.org/wiki/Comet_(programming). It mentions that browser should support multipart/x-mixed-replace to make XmlHttpRequest Streaming possible.
Why this multipart/x-mixed-replace is necessary?
Without this header, HTTP response can still be chunked and sent piece by piece to browser, right?
Hi,
Is there any way to change backlight turn off TIME using programming(Preferred c# or vb.net other c++ can be used too)? I guess, may be it is changed using registry info or API.
Manually, it is done by:
Setting Backlight (Battery Power and External Power)
Thank you
Is it possible to make a for-each loop in XSLT not for a node set, but for my own collection of elements? For example, I split some string and have a string collection as a result. And I need to create a node for each item in the collection. I know that issue can be solved with a recursive template, but I want to know if it is possible to avoid a recursion.
Im using the MbMenu jQuery plugin.
http://plugins.jquery.com/project/mbMenu
http://pupunzi.open-lab.com/2009/01/18/mbmenu/
I am probably being ridiculously stupid but I wish to have multiple menus on the same page, but not load them from external files (the html structure of the menu already exists on the page).
To me the only place you define what menu is linked to the element you call buildMenu on is the 'template' construction which is a external file.
Thanks.
I'm uisng a RichTextArea to display my html content in SL 4,I want to underline the content displayed by the control ( without modifying the html) and also attach an event of Onclick on the text . I tried different options i.e using RichTextArea in the content template of a Hyperlinkbutton but as the content of RichTextArea cannot be set directly, this was ruled out. Any suggestions ?
I have made a build system for my web application that's rewriting all resource url's to include the file's revision number (to improve client caching). As of today I'm running this command for each file to get the revision number:
hg log --template '{rev}\n' path-to-file
Executing hg for each file is really time consuming. Is there a fast way to list all files in a repository with the latest revision number?
I came upon Smarty which is a template engine. But there are also the Zend, CakePHP frameworks. Is Smarty like Zend, or are they completely different? Smarty just separates logic from display - is this similar to a framework like Zend?