Google Groups

Re: [Elgg development] Re: 'views' location issue


Krishna Shetty Feb 29, 2012 6:32 PM
Posted in group: Elgg development
Thank you all, it works fine now. I am really not sure why it didn't work earlier.

I see one more issue, the CSS file is taken only if it is kept in 'default' views of my plugin, it doesn't work if I keep the same in 'mobile' views of my plugin.
I am using  elgg_get_simplecache_url() and elgg_register_css() in start.php of my plugin and load the same in my view file. And I call elgg_set_viewtype() and elgg_register_viewtype_fallback() for 'mobile' in the start.php of my plugin before calling register CSS.

Thank you.

On Thu, Mar 1, 2012 at 12:07 AM, Evan Winslow <ev...@elgg.org> wrote:

Did you enable the plugin? Are you echoing the output? Have you checked the error logs? Did you turn on the views inspector from dev tools?

On Feb 29, 2012 6:43 AM, "Krishna Shetty" <krishna....@gmail.com> wrote:
Thank you. I made sure that 'Use simple cache' and 'Use view filepath cache'  are unchecked in administrator's Advanced Setting, but still it does not work.
Somehow it does not take the 'views' directory of my plugin.

It cannot even register and load the 'css' file from my plugin's 'views' directory, but it works if I keep the css file in elgg core's 'views/css' path.


On Wed, Feb 29, 2012 at 11:23 PM, Justin Richer <jri...@mitre.org> wrote:
Make sure that you flush the view cache when adding or changing a new view. This is available in the administrator's dashboard.

Elgg caches the list of views and their locations for performance reasons, and if you move a view around on the disk then you need to tell Elgg to flush the cache of the view locations before it will pick it up.

 -- Justin


On 02/29/2012 05:44 AM, Krishna Shetty wrote:
I tried keeping the same view file under   "views/default"  of my plugin, still it does not work.
I think my view type setting is correct. If I call elgg_get_viewtype() in  'mod/myplugin/pages/home.php'  it returns 'mobile'.

Any other suggestion to fix this?

I tried to set view location using elgg_set_view_location() in 'mod/myplugin/pages/home.php', but somehow it does n't work.

Thank you


On Wednesday, February 29, 2012 7:00:08 PM UTC+9, Pjotr wrote:
It looks like your locations are different: "views/mobile" VS "views/default". If you would add the stuff to "views/default" in your plugin, then it would work (I guess). I suppose this has something to do with viewtype, see the "elgg_view" method code: http://reference.elgg.org/1.8/views_8php_source.html#l00389

I have not done that ever, so a wild guess would be - you have to set the "viewtype" to mobile. I suppose you can see this method to see how it might go: http://reference.elgg.org/1.8/views_8php_source.html#l00097

On Wednesday, February 29, 2012 11:42:33 AM UTC+2, Krishna Shetty wrote:
I want to handle the first page of my site in my plugin. That is in  'mod/myplugin/pages/home.php'

In 'home.php' , I call elgg_view('home/homeview') . 
The homeview.php is kept in 'views'  folder of my plugin. That is  'mod/myplugin/views/mobile/home/homeview.php'  (Note: view type is set to mobile)

The issue is, elgg_view() does not take the 'homeview.php' which is in my plugin.

But, it works properly, if I keep the 'homeview.php'  in elgg core's 'views'  directory. That is it works when  elgg_install_dir/views/default/home/'homeview.php

Please suggest me the reason for this issue.


Thank you.

On Wednesday, February 29, 2012 7:00:08 PM UTC+9, Pjotr wrote:
It looks like your locations are different: "views/mobile" VS "views/default". If you would add the stuff to "views/default" in your plugin, then it would work (I guess). I suppose this has something to do with viewtype, see the "elgg_view" method code: http://reference.elgg.org/1.8/views_8php_source.html#l00389

I have not done that ever, so a wild guess would be - you have to set the "viewtype" to mobile. I suppose you can see this method to see how it might go: http://reference.elgg.org/1.8/views_8php_source.html#l00097

On Wednesday, February 29, 2012 11:42:33 AM UTC+2, Krishna Shetty wrote:
I want to handle the first page of my site in my plugin. That is in  'mod/myplugin/pages/home.php'

In 'home.php' , I call elgg_view('home/homeview') . 
The homeview.php is kept in 'views'  folder of my plugin. That is  'mod/myplugin/views/mobile/home/homeview.php'  (Note: view type is set to mobile)

The issue is, elgg_view() does not take the 'homeview.php' which is in my plugin.

But, it works properly, if I keep the 'homeview.php'  in elgg core's 'views'  directory. That is it works when  elgg_install_dir/views/default/home/'homeview.php

Please suggest me the reason for this issue.


Thank you.
--
You received this message because you are subscribed to the Google
Groups "Elgg development" group.
To post to this group, send email to elgg-dev...@googlegroups.com
To unsubscribe from this group, send email to
elgg-developme...@googlegroups.com
 
Elgg: http://elgg.org/
Remember, bug reports should be filed at http://trac.elgg.org/elgg!

--
You received this message because you are subscribed to the Google
Groups "Elgg development" group.
To post to this group, send email to elgg-dev...@googlegroups.com
To unsubscribe from this group, send email to
elgg-developme...@googlegroups.com
 
Elgg: http://elgg.org/
Remember, bug reports should be filed at http://trac.elgg.org/elgg!



--
thanks and best regards,
Krishna

--
You received this message because you are subscribed to the Google
Groups "Elgg development" group.
To post to this group, send email to elgg-dev...@googlegroups.com
To unsubscribe from this group, send email to
elgg-developme...@googlegroups.com
 
Elgg: http://elgg.org/
Remember, bug reports should be filed at http://trac.elgg.org/elgg!

--
You received this message because you are subscribed to the Google
Groups "Elgg development" group.
To post to this group, send email to elgg-dev...@googlegroups.com
To unsubscribe from this group, send email to
elgg-developme...@googlegroups.com
 
Elgg: http://elgg.org/
Remember, bug reports should be filed at http://trac.elgg.org/elgg!



--
thanks and best regards,
Krishna