request.folder never changes. There's surely some bug in the code cause if
you try to put , e.g.
STATIC_SOMETHING = 'never changes'
in models, and in a layout.html you do
{{=STATIC_SOMETHING}}
it gets printed in every page.
PS: why the "dinamically" in the title ? it's pretty much static ^_^
On Monday, May 20, 2013 9:04:11 PM UTC+2, Derek wrote:
>
> I'd start by debugging - the variable in question would be
> 'request.folder'. does it change in some way when the current page is a
> 'user' page?
>
> On Monday, May 20, 2013 11:53:06 AM UTC-7, Lamps902 wrote:
>>
>> I have a few pages (about, FAQ, terms of service) that are loaded from
>> text files in the static folder. The setup is basically like this:
>>
>> content_files = Storage()
>> file_handler =
>> open(os.path.join(request.folder,"static","content","about.txt"),'r')
>> content_files['about'] = file_handler.read()
>>
>> content_files_as_HTML['about'] = DIV(XML(content_files['about'] %
>> {'page_title':response.title or request.application,
>> 'email_contact':settings.email_contact,
>> }), _id='about_div', _style='line-height:12px')
>>
>> def about():
>> return dict()
>>
>>
>> If I click on one of the dynamically loaded pages from home or from most
>> other pages, it shows up fine. If, on the other hand, the current page is
>> one of the 'user' pages (i.e. default/user/register, default/user/login),
>> I get a blank page with a "404 NOT FOUND" error. Any idea as to what's
>> going on/how to fix it? Thanks.
>>
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.