[Radiant] Template field as link: possible?

2009-01-28 Thread Nate Turnage
There is a field in one of my templates that contains a link to an external
page and I would like to know how I can use that field in an a href or an
r:link / kind of tag.

I need something like this: a href=r:content part=link /r:title
//a

Is this possible in any way?



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


Re: [Radiant] Template field as link: possible?

2009-01-28 Thread Sean Cribbs
I assume you're talking about the templates extension.  And yes, all you 
need to do is put the code you typed in the appropriate place of the 
structure part of the template.


Sean

Nate Turnage wrote:

There is a field in one of my templates that contains a link to an external
page and I would like to know how I can use that field in an a href or an
r:link / kind of tag.

I need something like this: a href=r:content part=link /r:title
//a

Is this possible in any way?



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

  


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


Re: [Radiant] Template field as link: possible?

2009-01-28 Thread Nate Turnage
On Wed, Jan 28, 2009 at 10:34 AM, Sean Cribbs seancri...@gmail.com wrote:

 I assume you're talking about the templates extension.  And yes, all you
 need to do is put the code you typed in the appropriate place of the
 structure part of the template.



OMG! It does work. I thought that the quotes of the tag would interfere with
the href tag and I would need some other extension for it to work. This
rocks!



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


Re: [Radiant] Template field as link: possible?

2009-01-28 Thread Mohit Sindhwani

Nate Turnage wrote:

On Wed, Jan 28, 2009 at 10:34 AM, Sean Cribbs seancri...@gmail.com wrote:

  

I assume you're talking about the templates extension.  And yes, all you
need to do is put the code you typed in the appropriate place of the
structure part of the template.





OMG! It does work. I thought that the quotes of the tag would interfere with
the href tag and I would need some other extension for it to work. This
rocks!

  

So did I!  So, I wrote this for you:
 tag 'local:natelink' do |tag|
   part = tag.locals.page.parts.find_by_name('link')
   url = part.content
   a href=\#{url}\This is a link/a
 end

Darn!

Cheers,
Mohit.
1/29/2009 | 1:12 AM.

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


Re: [Radiant] Template field as link: possible?

2009-01-28 Thread Nate Turnage
On Wed, Jan 28, 2009 at 11:12 AM, Mohit Sindhwani t...@onghu.com wrote:


 So did I!  So, I wrote this for you:
  tag 'local:natelink' do |tag|
   part = tag.locals.page.parts.find_by_name('link')
   url = part.content
   a href=\#{url}\This is a link/a
  end

 Darn!


Thanks anyway. This really makes me think that I need to bone up on my rails
fu and ruby fu.

I need about 2 hours more per day.


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


Re: [Radiant] Template field as link: possible?

2009-01-28 Thread Sean Cribbs
Radius uses a really naive parsing method -- regular expressions -- so 
it won't try to match the a tag, and your Radius tags can appear anywhere.


Nate Turnage wrote:

On Wed, Jan 28, 2009 at 11:12 AM, Mohit Sindhwani t...@onghu.com wrote:

  

So did I!  So, I wrote this for you:
 tag 'local:natelink' do |tag|
  part = tag.locals.page.parts.find_by_name('link')
  url = part.content
  a href=\#{url}\This is a link/a
 end

Darn!




Thanks anyway. This really makes me think that I need to bone up on my rails
fu and ruby fu.

I need about 2 hours more per day.


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

  


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