Tintin81
Tintin81

Reputation: 10215

How to pass argument to SSI include directive?

Is there a better way to include a file and pass some arguments to it?

I am using this:

<!--#set var="title" value="Homepage" -->
<!--#include file="../includes/header.shtml" -->

But it doesn't work if you want to include the file multiple times in the same page with different titles.

Something like this would be nice:

<!--#include file="../includes/header.shtml" title="Homepage" -->

Unfortunately, it doesn't work.

Thanks for any help.

Upvotes: 1

Views: 1427

Answers (1)

Humberto Soares
Humberto Soares

Reputation: 11

Try using virtual includes not files includes :

<!--#set var="title" value="Appel" -->
<!--#include virtual="/includes/static/appel_a_temoins_form.html" -->

But your first code should work. Just set your vars before your includes files...

Upvotes: 1

Related Questions