{{from gluon.template import render}}
{{=XML(render(blog.body, context=response._vars))}}Don't know what that is but I'm digging in right now to find out.
Traceback (most recent call last):
File "gluon/restricted.py", line 205, in restricted
File "/Applications/web2py.app/Contents/Resources/applications/dev/views/default/blogs.html",
line 132, in <module>
File "gluon/template.py", line 919, in render
File "gluon/template.py", line 320, in __init__
File "gluon/template.py", line 720, in parse
File "gluon/template.py", line 454, in include
File "gluon/template.py", line 438, in _get_file_text
File "posixpath.pyc", line 62, in join
AttributeError: 'NoneType' object has no attribute 'endswith'
{{import os}}
{{from gluon.template import render}}
{{=XML(render(blog.body, path=os.path.join(request.folder, 'views'),
context=response._vars))}}Okay, so that works on everything except href="{{=URL('something')}} it returns the error "URL is not defined." I'm going to try the other anchor method available and see if that works.
The {{=blog.title}} and {{include 'postviews3.html'}} works fine with this solution.
{{pass}}
This all works, but I can't wrap my head around why everything after this snippet is no longer displayed. It does not even exist in the source. For example, my code is like this:
<div class="wrapper">
{{import os}}
{{from gluon.template import render}}
{{=XML(render(blog.body,path=os.path.join(request.folder, 'views'), context=globals()))}}
{{pass}}
<!--start-->
<div class="clear"></div>
<ul class="user">
<li class="white">NEW USER?</li>
<li><a href="{{=URL('register')}}"><img src="{{=URL('static','images/button_register.png')}}" alt="Login/Register to comment!" /></a></li>
</ul>
<ul class="user">
<li class="white">CURRENT USER?</li>
def blog_entry(): import os from gluon.template import render blog = XML(render(blog.body, path=os.path.join(request.folder, 'views'), context=globals()))
return dict(blog=blog){{=blog}}