Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author jamesckemp

    (@jamesckemp)

    Hi jukelabs,

    You can now use it in a more convenient way :

    <?php the_block('head'); ?>

    That will display all the css/js predefined in your page.xml file. If you only want to get one file, rather then all of them then I recommend just hand coding the tags, rather than using a function.

    The problem with just pulling in the full head is that it includes the page title as well as other meta tags that are set from within magento which you may not want on your wordpress pages.

    What I did is added another block function to the plugin I called get_block_obj that rather than returning the block after calling the toHtml method just returned the actual block object so that I could do the following:

    <?php echo get_block_obj("head")->getCssJsHtml(); ?>

    Alternatively, you could just do the following:

    <?php echo jck_mwi::layout()->getBlock('head')->getCssJsHtml() ?>

    Plugin Author jamesckemp

    (@jamesckemp)

    Good thinking Jonathon, I’ll have a look at implementing that solution for the next release

    Plugin Author jamesckemp

    (@jamesckemp)

    Thanks to Jonathon I have implemented a better method for getting the cssjs.

    You can now use the folowoing code:

    <?php echo get_block('head', false)->getCssJsHtml(); ?>

    The false parameter tells MWI to not render the head as HTMl, but rather return it as an object.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Magento WordPress Integration] JS/CSS Function’ is closed to new replies.