douzhang1115 2014-01-27 10:10
浏览 23

too long

I have been trying to write a plugin on elgg framework. So I tried to call specific css for a particular page by using elgg_extend_view() function which is not working. For example

 if(elgg_get_context()){
     elgg_extend_view('css/elgg', 'myplugin/css');
 }/*This works*/

But the following doesnt seem to work

if(!elgg_get_context()){ //If there is not elggcontext call no_css file
     elgg_extend_view('css/elgg', 'myplugin/no_css');
 }/*This is not working */

Can anybody tell me why?

  • 写回答

3条回答 默认 最新

  • douba2705 2014-01-29 12:36
    关注

    Apparently, you're misinterpreting expected behavior of elgg_get_context function.

    Check: http://reference.elgg.org/pageowner_8php.html#a25fe73eb19442b4a4476f18e63abf382 It uses strings as a context name (it has to be pushed first and is expected usually to be set just before pagesetup event)

    Conditional extension of elgg/css won't work correctly, due to caching. You probably want to use elgg_register_css and elg_load_css instead.

    评论

报告相同问题?

悬赏问题

  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗