templates_c question on the process of smarty

A place for users and developers of the Xataface to discuss and receive support.

Postby Markus » Mon Jun 11, 2007 6:55 am

Hi Steve, hi all


As far as I understand are the templates in template_c folder the ones my App uses right?

To better understand what is happening I would like to know how and when the templates in templates_c folder are generated by smarty.

Especially I am interested in the following:

What happens when I change a template in my Apps template folder?

What happens with the generated templates in template_c folder when changes are made to files in the the template folder?

What happens when I delete the generated templates in template_c folder?

Thank you

Markus



Markus
 
Posts: 94
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Mon Jun 11, 2007 9:03 am

What happens when I change a template in my Apps template folder?

It is recompiled into the templates_c directory.

What happens with the generated templates in template_c folder when changes are made to files in the the template folder?

They are replaced with updated ones.

What happens when I delete the generated templates in template_c folder?

They will be recompiled the next time they are needed.

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Markus » Mon Jul 16, 2007 12:31 am

Hi Steve,

that was what I guessed should happen and happens when I try it on my virtual server of my provider.

On another server i tried it and it very much seems that the changed and new templates I put into the template folder did not get recompiled.

I get errors like these:

Warning: Smarty::include(/opt/lampp/htdocs/bks_db/templates_c/default/%%C1^C1B^C1B5FE7E%%custom_find_form.html.php) [function.Smarty-include]: failed to open stream: No such file or directory in /opt/lampp/htdocs/dataface/lib/Smarty/Smarty.class.php on line 1251

Warning: Smarty::include() [function.include]: Failed opening '/opt/lampp/htdocs/bks_db/templates_c/default/%%C1^C1B^C1B5FE7E%%custom_find_form.html.php' for inclusion (include_path='.:/opt/lampp/htdocs/dataface:/opt/lampp/htdocs/dataface/lib:/opt/lampp/lib/php') in /opt/lampp/htdocs/dataface/lib/Smarty/Smarty.class.php on line 1251

I just put my custom_find_form.html into templates folder. Nothing happens in template_c


So my question: What has to be changed at that server to make it work. Do I have to change something in apache or php config files?

Thank you a lot

Markus
Markus
 
Posts: 94
Joined: Wed Dec 31, 1969 5:00 pm

Postby Markus » Mon Jul 16, 2007 12:35 am

Hi Steve,

>

that was what I guessed should happen and happens when I try it on my virtual server of my provider.

>

On another server i tried it and it very much seems that the changed and new templates I put into the template folder did not get recompiled.

>

I get errors like these:

>

Warning: Smarty::include(/opt/lampp/htdocs/bks_db/templates_c/default/%%C1^C1B^C1B5FE7E%%custom_find_form.html.php) [function.Smarty-include]: failed to open stream: No such file or directory in /opt/lampp/htdocs/dataface/lib/Smarty/Smarty.class.php on line 1251

>

Warning: Smarty::include() [function.include]: Failed opening '/opt/lampp/htdocs/bks_db/templates_c/default/%%C1^C1B^C1B5FE7E%%custom_find_form.html.php' for inclusion (include_path='.:/opt/lampp/htdocs/dataface:/opt/lampp/htdocs/dataface/lib:/opt/lampp/lib/php') in /opt/lampp/htdocs/dataface/lib/Smarty/Smarty.class.php on line 1251

>

I just put my custom_find_form.html into templates folder. Nothing happens in template_c

>



>So my question: What has to be changed at that server to make it work. Do I have to change something in apache or php config files?



>Thank you a lot



>Markus



And templates_c is chmod 0777 of course. Markus
Markus
 
Posts: 94
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Wed Jul 18, 2007 11:15 am

Tough to say.. I would start by completely deleting the contents of the templates_c folder and see if that helps at all.
-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Markus » Thu Jul 19, 2007 2:54 am

Tough to say.. I would start by completely deleting the contents of the templates_c folder and see if that helps at all.

>-Steve



Hi Steve,

i tried that already and then nothing happens in templates_c folder. It stays empty and my app gives a lot of error messages that it could not find the templates.

It must be something with the server I guess because on another server it works well.

Any more ideas?

Markus
Markus
 
Posts: 94
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri Jul 20, 2007 12:39 am

Make sure that the templates_c directory is writable by the webserver. e.g. chmod 0777

And it would be helpful to see what the error messages say.
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Markus » Fri Jul 20, 2007 6:13 am

Hi steve,

the messages I get, when deleting all of my templates in templates_c folder (which is definitely CHMOD 0777) are these:

Warning: Smarty::include(/opt/lampp/htdocs/bks_db/templates_c/default/%%81^81A^81A2A6A2%%Dataface_Login_Prompt.html.php) [function.Smarty-include]: failed to open stream: No such file or directory in /opt/lampp/htdocs/dataface/lib/Smarty/Smarty.class.php on line 1251

Warning: Smarty::include() [function.include]: Failed opening '/opt/lampp/htdocs/bks_db/templates_c/default/%%81^81A^81A2A6A2%%Dataface_Login_Prompt.html.php' for inclusion (include_path='.:/opt/lampp/htdocs/dataface:/opt/lampp/htdocs/dataface/lib:/opt/lampp/lib/php') in /opt/lampp/htdocs/dataface/lib/Smarty/Smarty.class.php on line 1251

Any idea?

Markus
Markus
 
Posts: 94
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri Jul 20, 2007 8:48 am

Interesting. There should be error messages before this telling you that it failed to create some folders or files.

Is PHP running in safe mode on this server?

you can tell by creating a file with
and opening it in your web browser.

Other than that, my guess would be that there was a problem with the install. Perhaps your account ran out of space and wasn't able to install the entire thing?

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Markus » Fri Jul 20, 2007 10:54 am

Hi Steve,

save mode is set to off at this server. As well it is on the other server I use where it works well.

I transferred all the some 12 MB of dataface folder again to the server, deleted my apps template_c/default folder and got the same result e.g. error messages as before...

Could there be kind of a server cache which prevents recompiling of the files in templates_c?

There is another thing happening on this server I can not explain.

When I put my plone.css where I attached the style for the table with id="result_list" to width:100% on my virtual server it works.
When I put the same plone.css with the changes on the other server it does not change anything. Is that strange?

Maybe this helps to have another idea?

I think, it is not really your job because it seems to have nothing to do with dataface. But maybe you as an expert have an idea.
If not, i will try to find this problem asking some sysadmin or searching the web.

Thank you anyway

Markus
Markus
 
Posts: 94
Joined: Wed Dec 31, 1969 5:00 pm

Re: templates_c question on the process of smarty

Postby jimr451 » Fri Sep 16, 2011 12:05 pm

Just an FYI - I had a similar problem with templates and it turned out to be a permissions problem.

I needed to turn on write permission for my web user for the templates_c/dataface directory. That immediately fixed the problem.

-Jim
Jim Roberts
Roberts WebForge, Inc.
http://www.robertswebforge.com
jimr451
 
Posts: 20
Joined: Mon Jun 27, 2011 1:46 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 28 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved