Hello,

I've built plugins for Joomla and Wordpress, and they both have some form of a "shortcode". Basically a snippet of code you can put into a page that will get rendered by the plugin.

Looking at the docs, this doesn't seem to be possible with Drupal. What is the best approach to doing this?

I've seen mention of full page nodes... but am still confused about how the user would embed something in the post.

Thanks!

-J

Comments

_

I'm not exactly sure what you mean by shortcode, but I can think of two things you might mean. First, you can embed php into any drupal node using the php code filter. Second, if you mean placing something like "[[mymodule]]" into a node that then gets acted upon by your custom module, then you're talking about a 'filter' in drupal terminology. For an example of this, see the tableofcontents module.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

In Drupal I would say the 3

In Drupal I would say the 3 main methods for outputting content on a page are
1) Generating page content, this approach uses hook_menu() and a callback to generate the output
2) Generating a block, uses hook_block()
3) Creating a filter, hook_filter()

So my guess is you are interested in approach 2 or maybe 3.

Adding method to render

Adding method to render function in drupal

4) use the create block in the block administration page + php filter and put the php code there
5) use print_r(function_name); in the page.tpl.php

Hope this helps.

--------------------------------------------------------------------------------------------------------
if you can use drupal why use others?
VicTheme.com
skype id : duckzland

thanks

cheers - we went with #2

Did you check out the

This question now has a correct answer... The shortcode module.

http://drupal.org/project/shortcode

nobody click here