21309 Posts in 5738 Topics by 2603 members
|Go to End|
13 June 2012 at 9:11pm
I want to reuse some shortcodes I have created, however I have quite a number of ‘Page types’ that use specific DataObjects and I don’t want to have to duplicate my shortcode functions for all of these.
Does anyone know if there is there a way to define a shortcode function in one place and then call it in for each DataObject?
14 June 2012 at 4:31am
I'm not quite sure if I understand you correctly - maybe you could give a small example of what you mean?
Anyway, to create different options for one and the same shortcode, you could maybe let the shortcodhandler call a Page method, and then override that method in your different Page classes. Or have the shortcode handler check it's Page classname, and act accordingly. Or use some parameter in your shortcode, if all else fails?
|Go to Top|