use of php files in templates
April 24, 2012 10:58AM
Hello,
I would like to set up the sphider search script for my website and would like to use php include function in modifying templates (header and footer, etc) to use already existing header / footer code from my website.
Seeing that the current templates are html files, php include function cannot be used ... Is there some way for sphider to use or include an existing file (for example: ".../includes/header.inc.php" ) as a header template instead of "header.html" in the templates directory for the search results page?
Re: use of php files in templates
April 25, 2012 09:37AM
Can´t you just replace the code in the current Sphider template files with the code you use in your site's header and footer files?

Also, if you place the following code in your .htaccess you can you use php includes in .html files:
AddType application/x-httpd-php .html .htm
Re: use of php files in templates
April 25, 2012 02:57PM
Hi

-------------------------------------------------------
> Can´t you just replace the code in the current
> Sphider template files with the code you use in
> your site's header and footer files?
-------------------------------------------------------

I would rather be able to use the same header file as is used for the whole website because the header file itself includes some regularly changing blocks of information which I would like to only have to edit in one place, rather than having to do edits in several places.

-------------------------------------------------------------
> Also, if you place the following code in your
> .htaccess you can you use php includes in .html
> files:
> AddType application/x-httpd-php .html .htm
--------------------------------------------------------------

I am not sure I understand this correctly ....
I could leave the template file as header.html and in the file itself use <?php include ...... ?> ?
Would the php script process even recognize it seeing the file ending remains "html"? or would I change the file name of the template file in the templates folder to header.php?

I appreciate your help. Thanks!
Re: use of php files in templates
April 25, 2012 04:29PM
1. You can simply change the include path in the Sphider php files where header and footer are called.

2. Yes, the <?php include ...... ?> will be recognized if you add the code snippet I posted to your .htaccess file.
Re: use of php files in templates
April 27, 2012 09:45PM
Hi Willy,

thanks for the info ... I am just now getting back and will try with the suggested information soon. I appreciate the assistance!
Cheers,
Wolfgang
Re: use of php files in templates
February 01, 2013 09:19AM
Maybe I can give you some advice,Just find my details in my information...

_________________________________________________________
rs gold
Sorry, only registered users may post in this forum.

Click here to login