0

Why can’t I place this in ce-img? is there a way around that or plugin that can do that?

‘$kentekenM’ comes from another database

{exp:ce_img:single 
        src="/images/uploads/kentekenplaat.gif" 
        text=" <?php echo "$kentekenM";?>|0,0|36|36|#000|system/expressionengine/third_party/ce_img/fonts/kenteken.ttf|left||left,top|52,18|100||||" 
        alt="kenteken {last_segment}” title=”{last_segment}” }

2 Answers 2

0

For php tags to work within a template you need to turn on php processing via a system setting. Your tag should work once you have done this.

Enabling php processing in a template is not always a good idea (it is turned off by default for a reason). Depending what else your template is doing there might be more appropriate ways of pulling in the value from the other database.

More information on this in the EE documentation.

0

I think, instead of Enabling PHP within a template, you should go for creating a small plugin (which have pi.plugin_name.php file inside plugin_name folder).

It is advice-able to create pi file because you can fire database query from this file. While you can also give more than one database connection in database.php (for EE2) and config.php (for EE3).

You just need to connect another database and fetch appropriate data from the pi file. And you can easily populate data into front-end by {exp:plugin_name}.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.