Welcome Guest, Not a member yet? Register   Sign In
Ocular Layout Library - A Rails Inspired Layout Library
#21

[eluser]kilishan[/eluser]
I worked with Chuck Cheeze on this one off the list, and we did find a bug in my code. It wasn't taking into account situations where the url might have index.php (or any other default file) visible in the URL. It was a simple fix to get the stylesheets working for him.

In the ocular_helper.php file, underthe function stylesheet_link_tag, replace the current $link_tag line with the following:

Code:
$link_tag = '<link rel="stylesheet" type="text/css" href="'.site_url().'/assets/stylesheets/' .
  $tag . '" media="' . $media . '" />' . "\n";

The main addition is adding site_url() to the string so that it gives an absolute path, not a relative one. A similar fix should be done in the javascript_link_tag function.

I'll look through the code for some other places this error might crop up before posting another version of the library. Also, my current version has a hacked together fix for my specific site and controllers in a sub-folder. I want to streamline this before releasing it.

Oh, and a previous poster was correct - in the assets.php controller, the class was misnamed. It should read Assets, not Asset.
#22

[eluser]kilishan[/eluser]
Just a quick note to let everyone know that I've setup a Google Code page for this project, and am opening it up to other volunteers that want to work on it. I've set up a better(?) set of docs for it, that will be expanded in the future, and a roadmap for future development.

I'd love to work with anyone else that is interested. Also, looking forward to working with the Matchbox guys to get a Module Manager API pinned down (as mentioned in their Google Group.

The next version is being wrapped up as fast as I can get it done (hopefully next week) and then will be posted there.

The new home is over at Google Code.
#23

[eluser]geshan[/eluser]
I have got into a problem with Ocular and objects (Data Mapper) - if anyone can help please see this : http://ellislab.com/forums/viewthread/133206/ - Thanks in advance.
#24

[eluser]Zeeshan Rasool[/eluser]
Hi all, i am using Ocular library its really amazing i just want to participate and ask a question that i use Ajax in view and if i talk about simple CI style then we can echo our result in controller but here i have to face some thing different that we have to return ajax result like:
Code:
$array["result"] = ''; // your result
$this->ocular->set_view_data('_viewName');
$this->ocular->render();
Is this required that we have to render again? can we just echo out result so that Ajax call get its automatically.

Thanks
#25

[eluser]Deep Arora[/eluser]
Problem - I am using the latest version of ocular and trying to load a custom layout saved in layout folder.

$this->template->render('login');

But it throws an error as "Unable to load the requested file: login".

The layout is there as I changed the default layout in config file to "login" and then it loaded without any issues. For some reason it is not loading the custom layout.

Any help pls?
#26

[eluser]kilishan[/eluser]
[quote author="Deep Arora" date="1263438051"]Problem - I am using the latest version of ocular and trying to load a custom layout saved in layout folder.

$this->template->render('login');

But it throws an error as "Unable to load the requested file: login".

The layout is there as I changed the default layout in config file to "login" and then it loaded without any issues. For some reason it is not loading the custom layout.

Any help pls?[/quote]

I think you're using Beta 1, by the sounds of it. There were a couple of stupid issues like that I missed somehow during the (very brief) testing of it. If you upgrade to Beta 2 you should be fine. If not, though, definitely let me know.
#27

[eluser]kilishan[/eluser]
[quote author="w a k e U P z e e" date="1258027887"]Hi all, i am using Ocular library its really amazing i just want to participate and ask a question that i use Ajax in view and if i talk about simple CI style then we can echo our result in controller but here i have to face some thing different that we have to return ajax result like:
Code:
$array["result"] = ''; // your result
$this->ocular->set_view_data('_viewName');
$this->ocular->render();
Is this required that we have to render again? can we just echo out result so that Ajax call get its automatically.

Thanks[/quote]

Dang. Somehow missed this one previously. I apologize, but I'll go ahead and answer it in case anyone else runs into this.

No, you don't have to Ocular to render out AJAX calls. Test for whether you're dealing with an AJAX call, and then echo, otherwise you can render a view.
#28

[eluser]Deep Arora[/eluser]
[quote author="kilishan" date="1263468791"][quote author="Deep Arora" date="1263438051"]Problem - I am using the latest version of ocular and trying to load a custom layout saved in layout folder.

$this->template->render('login');

But it throws an error as "Unable to load the requested file: login".

The layout is there as I changed the default layout in config file to "login" and then it loaded without any issues. For some reason it is not loading the custom layout.

Any help pls?[/quote]

I think you're using Beta 1, by the sounds of it. There were a couple of stupid issues like that I missed somehow during the (very brief) testing of it. If you upgrade to Beta 2 you should be fine. If not, though, definitely let me know.[/quote]

I am using Beta2 only. I even tried downloading it again, and folder reads Beta2 only. Looks like some other issue. Can you pls help?
#29

[eluser]Deep Arora[/eluser]
Another question - can we use this library with CI's template parser class?

$this->parser->parse('blog_template', $data);

How can we call this method using Ocular?
#30

[eluser]kilishan[/eluser]
How are your files laid out? I've got a site I'm working on using Ocular Beta2 and just ran a test and it worked fine. Now, I'm using themes for my site, but that shouldn't make a difference. Here's my structure that's working:

Code:
application
+ views
  + admin    // This is the admin 'theme'
  + default  // The default theme
    + layouts
      - application.php
      - test.php

In my welcome controller (which is using the default theme), I simply changed my call to:

Code:
$this->template->render('test');

and things worked as expected.

Could you do me a favor and add the following line to libraries/Template.php just after line 189 (if you're not using themes, or just after line 180 if you are using themes, to help me track down the problem:

Code:
echo 'Layout = ' . $layout;

Then let me know what the resulting string is. I'm just trying to track down what it's trying to load.

Another thought just occurred to me. Did you copy over the MY_Loader file into the application/libraries folder, or did you have to modify for Matchbox or another modules lib?




Theme © iAndrew 2016 - Forum software by © MyBB