Wrap your external placeholders in a snippet:
$ph = $modx->getPlaceholder('placeholder-name');
return $ph;
The phx plugin eats external placeholders. That’s one reason why I never use it; I use snippets instead. For internal use where it’s included with the snippet (in Ditto and Jot chunk tpls for example) it’s fine.
-
- 277 Posts
Hi Susan
thanks for your reply, guess I am not good enough in PHP to write this snippet.
thanks again
What I gave you will work; all you need to do is replace the "placeholder-name" with the name of the placeholder.
-
- 277 Posts
Susan
I still don’t get it. You mean I should wrap my PHx from above into a snippet and call it as snippet?
No. If you have a placeholder [+username+], phx will destroy the tags before MODx gets a chance to process it. The value is still in the $modx->placeholders array, though. So instead of using snippet tags you’ll use a snippet:
$ph = $modx->getPlaceholder('username');
return $ph;
Put the snippet where you would have put the placeholder. Keep in mind this is only for external placeholders, in your main template or the resource content. Placeholders in chunk tpls used by your WebLoginPE still work, as they are processed directly by WebLoginPE and not MODx.
-
- 277 Posts
Susan thanks
my problem seems to be different. I have the above PHx in my Template. Whenever I use
[[WebLogin? &loginhomeid=`8,18,7,5` &tpl=`Login`]]
modx ignores the complete PHx in my template. So the form is loaded twice into the page.
Oh, I see. Sorry about that
So this phx works on a page, but if you have the [!weblogin!] snippet on the page it loads both blocks of code in your phx? Do you have a link, or is this on a local environment?
Weblogin snippet (as well as any other dynamic snippets whose value needs to be processed in the next page load) has to be called uncached [!...!], unless the whole resource is uncached.