Plugin Author
benz1
(@benz1)
Looking into this, will come back to you if and when I have a solution.
Plugin Author
benz1
(@benz1)
Basically the php block is not designed to work with mixed content. It simply evaluates the entire content of the block as php (which is why we say to exclude the <?php ?> tags). If the block contains non-php then this is simply added to the content as it is – the JS will be executed as it’s client side but the php will not.
We may look at adding another block type that processes the <?php ?> in a future release. In the meantime if you are using Exec-PHP, try just adding your code as as a standard block type, e.g., anything other than a PHP block and see if Exec-PHP can handle it. Otherwise all I can suggest if that you create 3 blocks and add them one after the other:
Non-PHP Block
<script type="text/javascript">
var mytabs=new ddtabcontent("post-
PHP Block
the_ID();
Non-PHP Block
") //enter ID of Tab Container
mytabs.setpersist(true) //toogle persistence of the tabs' state
mytabs.setselectedClassTarget("link") //"link" or "linkparent"
mytabs.init()
</script>
and see if that works?
Would be interested to know if either of these solutions work?
Hi,
I’d already tried the first solution and it didn’t work.
Dividing the code up into 3 blocks and putting the shortcodes on separate lines in the post produced this:
<script type="text/javascript">
var mytabs=new ddtabcontent("post-<br />
82<br />
") //enter ID of Tab Container
mytabs.setpersist(true) //toogle persistence of the tabs' state
mytabs.setselectedClassTarget("link") //"link" or "linkparent"
mytabs.init()
</script>
Dividing up the code and putting the shortcodes on one line in the post produced:
<script type="text/javascript">
var mytabs=new ddtabcontent("post-[contentblock id=5]") //enter ID of Tab Container
mytabs.setpersist(true) //toogle persistence of the tabs' state
mytabs.setselectedClassTarget("link") //"link" or "linkparent"
mytabs.init()
</script>
For now, I’ll just paste this particular code directly into each post and look out for an update to your plugin in the future. Thanks!
Plugin Author
benz1
(@benz1)
Try running the following as a PHP Block:
echo '<script type="text/javascript">
var mytabs=new ddtabcontent("post-'.the_ID().'") //enter ID of Tab Container
mytabs.setpersist(true) //toogle persistence of the tabs state
mytabs.setselectedClassTarget("link") //"link" or "linkparent"
mytabs.init()
</script>';
I get:
82<script type="text/javascript">
var mytabs=new ddtabcontent("post-") //enter ID of Tab Container
mytabs.setpersist(true) //toogle persistence of the tabs state
mytabs.setselectedClassTarget("link") //"link" or "linkparent"
mytabs.init()
</script>
Plugin Author
benz1
(@benz1)
Sorry, looks like mixed type blocks won’t work in this version.
Thanks for looking into it anyway!