Hello All,
I’ve repeatedly come across an issue. I’m sharing my workaround, but would also like to understand what could be the underlying issue.
I have a custom form. Normally I expect that I can add it to any modele, inclure or squelette as follows:
<div class="ajax">
#FORMULAIRE_CUSTOM{#ID_CUSTOM}
</div>
However, when I do that, I see in the source of the website (public), the following HTML generated:
<div class="ajax"><!--?php
include_once("./" . _DIR_RACINE . "ecrire/balise/formulaire_.php");
if ($lang_select = "de") $lang_select = lang_select($lang_select);
inserer_balise_dynamique(balise_FORMULAIRE__dyn('FORMULAIRE_CUSTOM', '466'), array('plugins/custom/squelettes/modeles/custom.html', 'html_8d5b50854283f7d3a44fc620', '_anon_L1_b12xxx0a', 9, 'de'));
if ($lang_select) lang_select();
?--></div>
By reading the SPIP source, I was able to solve the issue, by instead of calling #FORMULAIRE…, I am using PHP to render out the form. This works without error. Here’s the example that works:
<div class="ajax">
<?php
include_spip('balise/formulaire_');
echo inserer_balise_dynamique(balise_FORMULAIRE__dyn('FORMULAIRE_CUSTOM', "#ID_CUSTOM"), array());
?>
</div>
Why would the original #FORMULAIRE… tag not work?
For the record, I am using , throughout the templates, as it has been pointed out that #MODELE should not be used in the squelettes. We are here maybe 2 or 3 levels deep into s.
Kind regards & thank you,
Urs