Fork me on GitHub

page vars (with PageUtil class) vs additional_header  Bottom

  • New page vars with PageUtil class are really great staff.
    But there is one thing missing - old additional_header plugin allows us to add to header everything what we needed. This was specially helpful when need to add Internet Explorer conditional comments (e.g. to apply for ie dedicated stylesheet).
    If I'm not wrong whit PageUtil we cannot do this. We cant ad raw text - but it is added inside body tag. To head we can add only stylesheets, scripts and so on - but without conditional comments.

    Would it possible to add this feature to page util? Or maybe there is some way to add conditional comments to header using PageUtil?

    Thanks in advance for replay!
    Greetings


    --
    Polish Zikula Team
    Bianor Works - my Zikula works on CoZi
  • You can use the rawtext page var type.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Yes - with rwatext its working.
    Thanks icon_smile

    --
    Polish Zikula Team
    Bianor Works - my Zikula works on CoZi
  • and in 0.764 how to do it? icon_confused
    additional_header launch me an error when i try to insert text/css with IE conditionals...

    --
    - Mateo T. -
    Mis principios... son mis fines
  • With page vars you can add conditional comments this way:

    Code

    <!--[pnpageaddvar name="rawtext" value=$smarty.ldelim|cat:'if IE]> <li-nk rel="stylesheet" href="path_to_eg_stylesheet/ie-fixes.css" type="text/css"></li-nk><![endif'|cat:$smarty.rdelim]-->


    With old additional_header:

    Code

    <!--[add_additional_header header=$smarty.ldelim|cat:'if IE]><li-nk rel="stylesheet" href="path_to_eg_stylesheet/ie-fixes.css" type="text/css"></li-nk<![endif'|cat:$smarty.rdelim]-->


    Both examples produce:

    Code

    <!--[if IE]>
    <li-nk rel="stylesheet" href="path_to_eg_stylesheet/ie-fixes.css" type="text/css"></li-nk><![endif]-->


    Short explanation: we cannot write the comment in normal way, because tag to open comment is reserved by Smarty (actually by pnRender) as delimiter.
    For this purpose we can use one of Smarty reserved var: $smarty.ldelim nad $smarty.rdelim.
    More: http://smarty.php.net/manual/en/language.function.ldelim.php



    Edit: of course in code-blocks all "li-nk" have to be replaced by "link" (bbcode is cuting link tags icon_rolleyes )



    edited by: Jusuff, Jul 31, 2007 - 09:13 PM

    --
    Polish Zikula Team
    Bianor Works - my Zikula works on CoZi

This list is based on users active over the last 60 minutes.