Re: [Radiant] How to make a virtual page like '/page/:id'

2008-01-20 Thread Sean Cribbs

> Thanks Sean. To my surprise, somehow I managed to make it work not long
> after clicking on the send button. I also found your extension which helped
> somehow, together with the archive extension. Who would say that simply
> stearing long enough at the code you don't really understand could get you
> somewhere. :) My head is spinning, but its fun.
>
> Now I need to make use of model associations. I see the syllabi is
> associated with courses etc, but haven't found yet how you use it in the
> tags.
>   
Look in lib/syllabi_tags.rb for how the majority of the tags are 
defined.  Basically, there's , ,  tags 
and various others below it.  All they do is assist in looping over the 
associations and emitting attributes, really.


Sean
___
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


[Radiant] Helper code for logging loaded extensions

2008-01-20 Thread Mario T. Lanza
I am working on a custom project and developing my own extensions and
plugins.  Additionally, I am integrating third party extensions into my
Radiant site.  Periodically, these custom or third party extensions have
issues that prevent the application from properly loading, particularly
when uploading a site to a host.  The error message you get in console
sometimes is cryptic and so you're not really even thinking that an
extension may be to blame.  At least this was true with me...

I found it extremely helpful for debugging to put a line something like
this at the top of my extension files:

  puts "Loading MyExtension..."

Since then I've simply moved this to a separate file:

load_loaded_dependencies.rb:

module Dependencies
  alias old_log_call log_call
  def log_call(*args)
begin
  relative_filename =
(args[0].to_s.match('/vendor/.*')[0]).to_s.gsub('/vendor/','') rescue
nil
  puts "Loading dependency: #{relative_filename}" if
relative_filename && relative_filename != @@last_relative_filename
  @@last_relative_filename = relative_filename
rescue
ensure
  old_log_call args
end
  end
end


Then, I simply require this file at the top of my environment.rb file.

Hope this is useful to someone else.

Mario
-- 
Posted via http://www.ruby-forum.com/.
___
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] How to make a virtual page like '/page/:id'

2008-01-20 Thread nn
On Jan 20, 2008 8:01 PM, Sean Cribbs <[EMAIL PROTECTED]> wrote:

> You're on the right track.  The "/people" page should be of a custom
> type that you create so that all child URLs are routed to a single
> virtual child page.  I did this for the "Syllabi" at KCKCC over a year
> ago.  Here's a link to the code:
>
> http://kck.esumm.com/www/html/vendor/extensions/syllabi/app/models/
>
> Look specifically at the "Syllabi Courses Page" and the "Syllabi
> Prefixes Page".  The "prefixes" page was used as the parent, the
> "courses" page as the virtual child.  You can see these in action at:
>
> http://www.kckcc.edu/academics/course-descriptions/


Thanks Sean. To my surprise, somehow I managed to make it work not long
after clicking on the send button. I also found your extension which helped
somehow, together with the archive extension. Who would say that simply
stearing long enough at the code you don't really understand could get you
somewhere. :) My head is spinning, but its fun.

Now I need to make use of model associations. I see the syllabi is
associated with courses etc, but haven't found yet how you use it in the
tags.
___
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] How to make a virtual page like '/page/:id'

2008-01-20 Thread Sean Cribbs
You're on the right track.  The "/people" page should be of a custom 
type that you create so that all child URLs are routed to a single 
virtual child page.  I did this for the "Syllabi" at KCKCC over a year 
ago.  Here's a link to the code:

http://kck.esumm.com/www/html/vendor/extensions/syllabi/app/models/

Look specifically at the "Syllabi Courses Page" and the "Syllabi 
Prefixes Page".  The "prefixes" page was used as the parent, the 
"courses" page as the virtual child.  You can see these in action at:

http://www.kckcc.edu/academics/course-descriptions/

Cheers,

Sean

nn wrote:
> While developing my first Radiant site I encountered a problem which
> overwhelms me. Also, I'm not a programmer, so its only worse. Please bear
> with me.
>
> First, I tried to make a page "/people" which lists all the people in the
> organization. So, I wrote "People" extension (my first), wrote some tags,
> and now I can enter a person into the database  through the admin interface,
> and list every person in the database on the "/people" page. A small
> victory. Unfortunately, it doesn't end here.
>
> Now I need to display everything there is about a person, but I don't want
> to make a separate child page for each person. I think one page should be
> sufficient for that, so a virtual page is in order, right? Well, I tried
> that, and failed miserably. It getting frustrating, since I've been hanging
> with Google for more then two days now. Either the examples I found are too
> complex, or my skull is too thick. At the moment, I'm betting on the latter.
>
> So, hopefully, someone has already been there and can show in a simple way
> how to achieve what I need to.
>
> Thanks.
> ___
> Radiant mailing list
> Post:   Radiant@lists.radiantcms.org
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
>
>   

___
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


[Radiant] How to make a virtual page like '/page/:id'

2008-01-20 Thread nn
While developing my first Radiant site I encountered a problem which
overwhelms me. Also, I'm not a programmer, so its only worse. Please bear
with me.

First, I tried to make a page "/people" which lists all the people in the
organization. So, I wrote "People" extension (my first), wrote some tags,
and now I can enter a person into the database  through the admin interface,
and list every person in the database on the "/people" page. A small
victory. Unfortunately, it doesn't end here.

Now I need to display everything there is about a person, but I don't want
to make a separate child page for each person. I think one page should be
sufficient for that, so a virtual page is in order, right? Well, I tried
that, and failed miserably. It getting frustrating, since I've been hanging
with Google for more then two days now. Either the examples I found are too
complex, or my skull is too thick. At the moment, I'm betting on the latter.

So, hopefully, someone has already been there and can show in a simple way
how to achieve what I need to.

Thanks.
___
Radiant mailing list
Post:   Radiant@lists.radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant