send me your files off-list.

ceej wrote:
Hi Tim,

I already followed that tutorial to the T, as soon as I use
<xi:include href="" /> everything just stops working.
If I then remove it works fine again.
(I basically just copied and pasted that tutorial as a test)

Any other ideas?

Many thanks

On Dec 2, 5:48 am, Timothy Farrell <[EMAIL PROTECTED]> wrote:
  
Make sure that you're included file is also a proper XML file with the appropriate namespaces.  The official method is explained here:http://genshi.edgewall.org/wiki/GenshiTutorial#AddingaLayoutTemplate
Let me know if you'd like some more help beyond that.
-tim
ceej wrote:Using <xi:include href="" /> seems to kill genshi4web2py, it doesn't error out or anything it loads the html file but doesn't convert all the genshi things just leaves it like <title py:content="'New Title'">this will be replaced</title> instead of turning it into <title>New Title</title> Any ideas? Have you run into this problem Tim while trying to setup templates? Many thanks On Dec 1, 4:10 pm, ceej<[EMAIL PROTECTED]>wrote:Was just a bad install, I installed using mac ports and now works just fine :) On Dec 1, 3:45 pm, ceej<[EMAIL PROTECTED]>wrote:and i do have genshi installed:blank:source blank$ easy_install genshi Searching for genshi Best match: Genshi 0.5.1 Processing Genshi-0.5.1-py2.5-macosx-10.5-i386.egg Genshi 0.5.1 is already
 the active version in easy-install.pthUsing /Library/Python/2.5/site-packages/Genshi-0.5.1-py2.5-macosx-10.5- i386.egg Processing dependencies for genshi Finished processing dependencies for genshiOn Dec 1, 3:42 pm, ceej<[EMAIL PROTECTED]>wrote:I seem to be getting an error, I'm importing like this:import applications.myapp.modules.Genshi4web2py as Genshi4web2py response.postprocessing.append(lambda x: Genshi4web2py.render(x, request, response))but i get this:http://paste.pocoo.org/show/93469/On Dec 1, 11:23 am, Timothy Farrell<[EMAIL PROTECTED]>wrote:Also note that your Genshi templates (views) must be valid XML.  If they aren't Genshi will raise an exception. There's a URL in the PDF of Genshi's Documentation website.
  It's ok, but could use some attention.  Feel free to ask me questions. -tim Timothy Farrell wrote:The article in Alter-Ego shows how to setup your controller to default to Genshi templates.  But if it fails, it will fall-back to normal web2py templates. Basically your init/controllers/default.py controller should look like this:response.postprocessing.append(lambda x: Genshi4web2py.render(x, request, response)) def index(): numbers = range(0,10) return dict(text="Welcome to Genshi4web2py", nums = numbers)The corresponding view (init/views/default/index.html) could look like:<html xmlns:py="http://genshi.edgewall.org/"xmlns="http://www.w3.org/1999/xhtml"xmlns:xi="http://www.w3.org/2001/XInclude"> <head>   <title>Genshi4w
eb2py Demo</title> </head> <body>   <h1>${text}</h1>   <ol>     <li py:for="">This is number ${n}<li>   </ol> </body> </html> As far as making Genshi templates, see the attached cheatsheet.  I made this for my co-worker.  It should give you a basic primer.  Before you use XInclude too much, note that Genshi makes full use of XSLT and you can use one included template to completely transform another.  I use this method for including my default header but it is not necessary by any means.  If the XSLT part confuses you, ignore it, you don't need it to understand use Genshi. Does that help? -tim billf wrote:What is the best link for a quick intro of how to use genshi templates with web2py? I don't mean install/configure but examples of actual controllers/templates/outputs. On Dec 1, 4:53 pm, Timothy Farrell<[EMAIL PROTECTED]>wrote:Massimo has posted a more recent Genshi4web2py.py module in AlterEgo for me.  If you use (want to use) Genshi with web2py, you can get it from:http://mdp.cti.depaul.edu/AlterEgo/default/show/162Thisnew version adds cache support (for a large speed boost) and full Genshi rendering options in a configurable manner.  It should be backward compatible with the old version. Let me know if you run into anything.-- Timothy Farrell<[EMAIL PROTECTED]>Computer Guy Statewide General Ins urance Agency (www.swgen.com)-- Timothy Farrell<[EMAIL PROTECTED]>Computer Guy Statewide General Insurance Agency
 (www.swgen.com)-- Timothy Farrell<[EMAIL PROTECTED]>Computer Guy Statewide General Insurance Agency (www.swgen.com)-- Timothy Farrell<[EMAIL PROTECTED]>Computer Guy Statewide General Insurance Agency (www.swgen.com)
    

  

-- 
Timothy Farrell <[EMAIL PROTECTED]>
Computer Guy
Statewide General Insurance Agency (www.swgen.com)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to