Hi
I have a plugin that returns “en” or “sv” (for example) depending on which language the user has choosen.
What I know want to do is to add this en/sv text to my channel field to get the correct field for the specific language. I try doing this like this:
{field_{exp:plugin:code}}When I run it within the template it just outputs “{field_en}” as a text instead of the actual contents of the field (for example “Headline”).
Any ideas how I can work around this? So the field name gets sent in before the tag tries to fetch the field from the data (I’m guessing that the issue).
Also this doesn’t work either (which it did in EE1.6.x):
{field_<?php echo "en"; ?>}It also outputs just the tag name like “{field_en}”.
Moved to Plugins by Moderator
esset,
Regarding your PHP echo
PHP parsing is set to YES. Does this work for you guys?
Do you have Parsing Stage set to output or input is what I mean. See attached.
Regarding your plugin
I wrote the plugin. It works with EE2.0. {exp:plugin:code} just does a return on “en”.
You may be better off posting to the ExpressionEngine 2.0 Beta: Add-ons forum with your actual plugin code as its not necessarily technical support.It may just be a parsing issue.
Hi John
Changing PHP parsing state to “INPUT” worked for {field_<?php echo "en"; ?>}
It now outputs “Headline” from the channel field in my template.
But it didn’t do anything for {field_{exp:plugin:code}}.
Shouldn’t these work the same way?
plugin:code function is just as follows:
function code(){
return "en";
}Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.