Discussion:
Wordpress equivelent of Expression Engines template editor?
Micky Hulse
2013-05-29 23:13:19 UTC
Permalink
Hello,

I hate to say it, but I've wasted half my day trying to get PHP to
parse in pages.

I've come close to successful eval of PHP code (only for super
admins), but the PHP opening tag gets converted to "< ?php" (notice
the rogue space) when saving the page in the admin (I'd love to know
what code is responsible for inserting that space!)

Long story short, I know it's not the best idea to allow PHP in pages,
but I'd really like to get similar functionality as the
ExpressionEngines template editor.

<http://ellislab.com/expressionengine>

For those not familiar with EE, they have a "template" editor that
allows you to essentially store your template code in the database. On
top of allowing PHP, you can also easily specify a URL to said
template.

In WP, is there any workflow that would get me close to the
functionality that the EE template editor offers?

The closest I've come in WP is to setup custom page templates. Pages
are cool because you can create custom URLs to your page, it's just
that I don't have the ability to put my template code/PHP within the
page itself.

Just curious if I'm overlooking something.

Thanks!
Micky
Andrew Bartel
2013-05-29 23:23:01 UTC
Permalink
http://wordpress.org/plugins/allow-php-in-posts-and-pages/
Post by Micky Hulse
Hello,
I hate to say it, but I've wasted half my day trying to get PHP to
parse in pages.
I've come close to successful eval of PHP code (only for super
admins), but the PHP opening tag gets converted to "< ?php" (notice
the rogue space) when saving the page in the admin (I'd love to know
what code is responsible for inserting that space!)
Long story short, I know it's not the best idea to allow PHP in pages,
but I'd really like to get similar functionality as the
ExpressionEngines template editor.
<http://ellislab.com/expressionengine>
For those not familiar with EE, they have a "template" editor that
allows you to essentially store your template code in the database. On
top of allowing PHP, you can also easily specify a URL to said
template.
In WP, is there any workflow that would get me close to the
functionality that the EE template editor offers?
The closest I've come in WP is to setup custom page templates. Pages
are cool because you can create custom URLs to your page, it's just
that I don't have the ability to put my template code/PHP within the
page itself.
Just curious if I'm overlooking something.
Thanks!
Micky
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Micky Hulse
2013-05-29 23:45:54 UTC
Permalink
Thanks for the quick reply Andrew! I really appreciate it.
Post by Andrew Bartel
http://wordpress.org/plugins/allow-php-in-posts-and-pages/
I've actually looked at that plugin. Seems like OK code. Have you used?

I guess I was just trying to avoid using plugin for this one.

Honestly though, I think I probably should forget about allowing raw
PHP tags in posts ... Probably safer that way.

The EE "create a template, one that allows for PHP and EE tags, and
give it a url" is a pretty nice feature ... Of course, a custom page
templates would get me 95% of the way to that type of functionality. I
was mostly wondering if there's a workflow/feature that I was
overlooking.

Sorry if this is a stupid/bad question for this list.

Have a good one!

Cheers,
m
Mickey Panayiotakis
2013-05-30 13:36:40 UTC
Permalink
I use this regularly: http://wordpress.org/plugins/shortcode-exec-php/
It lets the admin create custom shortcodes using PHP, so you get the
functionality of doing whatever you want to do with PHP but still don't
need authors to know php to use it.


--

Mickey Panayiotakis
Managing Partner
800.270.5170 x512
<http://www.infamia.com>
ohad raz
2013-05-30 13:43:33 UTC
Permalink
Give my plugin a try http://wordpress.org/plugins/shortcodes-ui/
it creates a UI for creating shortcode which can be defined to use PHP
and also creates a nice tinymce editor button for you to embed this
shortcode into your editor
Post by Mickey Panayiotakis
I use this regularly: http://wordpress.org/plugins/shortcode-exec-php/
It lets the admin create custom shortcodes using PHP, so you get the
functionality of doing whatever you want to do with PHP but still don't
need authors to know php to use it.
--
Mickey Panayiotakis
Managing Partner
800.270.5170 x512
<http://www.infamia.com>
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
--
Ohad Raz,
WordPress Consultant <http://en.bainternet.info/> | WordPress
Developer<http://en.bainternet.info/>| WordPress
Freelancer <http://en.bainternet.info/>
Micky Hulse
2013-05-30 17:19:51 UTC
Permalink
Interesting! Thanks for the tips Mickey and Ohad. I'll give the
shortcode technique a whirl. Seems like a good workaround to the code
I was trying to write.

After giving this some more though, and having caught up on my sleep,
I think a combination of shortcodes and custom page templates will
work for my needs.

Thanks for everyone's help! I really appreciate it.

Happy coding all!

Cheers,
Micky
Post by ohad raz
Give my plugin a try http://wordpress.org/plugins/shortcodes-ui/
it creates a UI for creating shortcode which can be defined to use PHP
and also creates a nice tinymce editor button for you to embed this
shortcode into your editor
Post by Mickey Panayiotakis
I use this regularly: http://wordpress.org/plugins/shortcode-exec-php/
It lets the admin create custom shortcodes using PHP, so you get the
functionality of doing whatever you want to do with PHP but still don't
need authors to know php to use it.
--
Mickey Panayiotakis
Managing Partner
800.270.5170 x512
<http://www.infamia.com>
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
--
Ohad Raz,
WordPress Consultant <http://en.bainternet.info/> | WordPress
Developer<http://en.bainternet.info/>| WordPress
Freelancer <http://en.bainternet.info/>
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
--
http://hulse.me
Loading...