Menu icon Foundation
F5 Interchange partials + php

Hi everyone,

Is there a way to use interchange template loading with php partials?

The problem is that the php code inside the partial is not being rendered as it would when loading it without ajax.

This is very limiting and if there is no way to deal with php in partials, then this will be a deal breaker.

I hope you guys have a solution for this - how to handle php data inside a template that is not being loaded with the page, but via Interchange (ajax).

Thanks,
Nemanja

interchangePHP

Hi everyone,

Is there a way to use interchange template loading with php partials?

The problem is that the php code inside the partial is not being rendered as it would when loading it without ajax.

This is very limiting and if there is no way to deal with php in partials, then this will be a deal breaker.

I hope you guys have a solution for this - how to handle php data inside a template that is not being loaded with the page, but via Interchange (ajax).

Thanks,
Nemanja

Nemanja Milosavljevic over 5 years ago

When I use reflow, as it was suggested:
$(document).foundation('interchange', 'reflow');

Or just reflow like so:
$(document).foundation('reflow');

Entire foundation stops working, and no error is posted.

This is just puzzling to me.

Please help.

Rafi Benkual about 4 years ago

Interchange has a replace function that you can trigger

 $(document).foundation();
$("#swap").on("replace", function() {
  $(document).foundation();
});

The id swap is the id of the div you are adding.

Lesson:
http://zurb.com/university/lessons/serve-users-only-the-files-they-need

In terms of PHP it could be more involved. See a prior post that should help:
http://foundation.zurb.com/forum/posts/493-interchange-with-wordpress
http://foundation.zurb.com/forum/posts/5801-interchange-not-loading-php-files-due-to-file-permissions