Re: [Radiant] Index at top of page ??`
On Mon 16 Mar 2009 23:59, Anton Aylward anton.aylw...@rogers.com wrote: Sean Cribbs said the following on 03/16/2009 11:39 AM: I don't understand. Do you mean a Table of Contents? Yes, but more than that. I realise my subject isn't quite right but I really don't know how to explain it in one line. Here's the business use-model: While many sites that list presentation and events have the speaker bio/background on the same page as the event, our board has decided that there will be ONE page that has ALL the speakers we have ever had listed, along with whatever else we can get, photos, contact etc. You mean, sorta like this? http://www.eu.apachecon.com/c/aceu2009/speakers -- J Aaron Farr jadetower.com[US] +1 724-964-4515 馮傑仁 cubiclemuses.com [HK] +852 8123-7905 ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Index at top of page ??`
On 17.03.2009, at 03:15, Mohit Sindhwani wrote: Andrew Neil wrote: You could try this: * Create each bio page separately as you suggested I agree. This is a good way to go. * Create a special page part called 'anchor' in the bio page You could then write a special tag that creates a link to that anchor using r:children:each and a special tag similar to r:content called r:content_anchor that spits out the anchor in the HTML before doing the r:content for the child page? No need for an extra page part, you can just use the slug. For a page to pass as HTML valid, one of the requirements is that no two elements share the same id. Likewise, Radiant enforces that no two sibling pages have the same slug. Output the content like this: r:children:each div id=r:slug/ r:content/ /div /r:children:each And the index like this: r:children:each a href=#r:slug/r:title//a /r:children:each That's good! I always get confused whether #r:slug / works! But I guess it does. Also, do div IDs work as anchors? Or should that be changed to: a name=r:slug / ... /a This really is much cleaner! No tags needed :) Well in xhmtl 1.0 the name attribute for a elements is depricated, in xhtml 1.1. it was removed. In html4 it's allowed, html 5.0 usese id and name linking but does not allow the name attribute for a elements as far as i know. So in modern browsers use id linking =) Greetings Cheers, Mohit. 3/17/2009 | 10:15 AM. ___m i c h a e l s t a r k e co-founder of HicknHack Software GbR www.hicknhack.com Graphics ___c o n t a c t +49 (170) 3686136 +49 (351) 4045428 cont...@hicknhack.com ___H i c k n H a c k S o f t w a r e G b R maik lathan - andreas reischuck - michael starke hübnerstraße 8 01069 dresden - germany ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
[Radiant] Index at top of page ??`
Is there some way with Radiant to automatically generate an index of the headings at the top of the page, as we see on so many sites? I realise that I can have a r:children:each * r:link / r:content //p /r:children:each that would pull the sub-pages together and give the appearance of one page, and another loop at the top for the index . ... BUT ... I want to be able to link to the middle of that page from another page. I can see how to link to the child page from a remote page, but not 'into' a page that has been built in this way. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Index at top of page ??`
I think he means anchors! That's a good question - I have no idea how to generate anchors automatically in a Radiant page. I don't think there's a direct way :( Cheers, Mohit. 3/16/2009 | 11:50 PM. Sean Cribbs wrote: I don't understand. Do you mean a Table of Contents? Sean Anton Aylward wrote: Is there some way with Radiant to automatically generate an index of the headings at the top of the page, as we see on so many sites? I realise that I can have a r:children:each * r:link / r:content //p /r:children:each that would pull the sub-pages together and give the appearance of one page, and another loop at the top for the index . ... BUT ... I want to be able to link to the middle of that page from another page. I can see how to link to the child page from a remote page, but not 'into' a page that has been built in this way. ___ 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 ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Index at top of page ??`
Sean Cribbs said the following on 03/16/2009 11:39 AM: I don't understand. Do you mean a Table of Contents? Yes, but more than that. I realise my subject isn't quite right but I really don't know how to explain it in one line. Here's the business use-model: While many sites that list presentation and events have the speaker bio/background on the same page as the event, our board has decided that there will be ONE page that has ALL the speakers we have ever had listed, along with whatever else we can get, photos, contact etc. This means that has to be some way to link INTO that page from a remote page, in particular the page with the event on it. Yes, there needs to be a table of contents at the top of the page (which is updated as new speaker details are added), but I can figure that out. The index isn't the killer; referencing INTO the page is. As I said, my current idea is the page-per-speaker model and the r:children:each loop to build the page. This takes care of the browsable single page and the automatic update as new (child) pages get added. I think I can figure a ToC, but suggestions are welcomed. While I can figure the link from the presentation page to a single (child-of...) page for the speaker I can't figure out how to make that a reference INTO the page built by the r:children:each loop. I realise that I can actually have one page where the information is edited in and the ToC is built by hand and has the relevant markers to link to, but it seems a lot of hard work. I though CMSs were supposed to help you get around all that 'do-it-by-hand' stuff. -- The way that can be followed is not the Way The truth that can be told is not the Truth ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Index at top of page ??`
Mohit Sindhwani said the following on 03/16/2009 11:50 AM: I think he means anchors! That's a good question - I have no idea how to generate anchors automatically in a Radiant page. I don't think there's a direct way :( Half way there! Not just the anchors but some 'standard' thing so that the anchors can be referenced in a regular and consistent and predictable manner. -- Ignorance is never out of style. It was in fashion yesterday, it is the rage today, and it will set the pace tomorrow. -- Franklin K. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Index at top of page ??`
Anton Aylward wrote: Sean Cribbs said the following on 03/16/2009 11:39 AM: I don't understand. Do you mean a Table of Contents? Yes, but more than that. I realise my subject isn't quite right but I really don't know how to explain it in one line. Here's the business use-model: While many sites that list presentation and events have the speaker bio/background on the same page as the event, our board has decided that there will be ONE page that has ALL the speakers we have ever had listed, along with whatever else we can get, photos, contact etc. This means that has to be some way to link INTO that page from a remote page, in particular the page with the event on it. Yes, there needs to be a table of contents at the top of the page (which is updated as new speaker details are added), but I can figure that out. The index isn't the killer; referencing INTO the page is. As I said, my current idea is the page-per-speaker model and the r:children:each loop to build the page. This takes care of the browsable single page and the automatic update as new (child) pages get added. I think I can figure a ToC, but suggestions are welcomed. While I can figure the link from the presentation page to a single (child-of...) page for the speaker I can't figure out how to make that a reference INTO the page built by the r:children:each loop. I realise that I can actually have one page where the information is edited in and the ToC is built by hand and has the relevant markers to link to, but it seems a lot of hard work. I though CMSs were supposed to help you get around all that 'do-it-by-hand' stuff. You could try this: * Create each bio page separately as you suggested * Create a special page part called 'anchor' in the bio page You could then write a special tag that creates a link to that anchor using r:children:each and a special tag similar to r:content called r:content_anchor that spits out the anchor in the HTML before doing the r:content for the child page? I hope I make sense. Cheers, Mohit. 3/17/2009 | 12:07 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] Index at top of page ??`
Mohit Sindhwani wrote: You could try this: * Create each bio page separately as you suggested * Create a special page part called 'anchor' in the bio page You could then write a special tag that creates a link to that anchor using r:children:each and a special tag similar to r:content called r:content_anchor that spits out the anchor in the HTML before doing the r:content for the child page? I hope I make sense. Cheers, Mohit. 3/17/2009 | 12:07 AM. OK, I did this for you. I hope that these tags help you get started. If you have a page part called 'anchor', then the first one renders the link (for the table of contents) to an anchor within the same page. The second one renders a heading for the actual item, creating the anchor there. Names of anchors are specified in the 'anchor' page part of the bio. tag 'local:anchor_link' do |tag| part = tag.locals.page.parts.find_by_name('anchor') text = part.content #a name=\#{text}\nbsp;/a a href=\##{text}\#{tag.locals.page.title}/a end tag 'local:anchor_cover' do |tag| part = tag.locals.page.parts.find_by_name('anchor') title = tag.locals.page.title text = part.content a name=\#{text}\#{title}/a end In the page from which all bios are listed, you do this: To create the table of contents: h1. Bio r:children:eachr:if_content part=anchor * r:local:anchor_link //r:if_content/r:children:each The output for this is something like: Bio * Sienfeld (links to -- http://localhost:3700/bio#sienfeld) * Jerry (links to -- http://localhost:3700/bio#jerry) Further down, to create the list, you do: h1. Details -- r:children:eachr:if_content part=anchor * r:local:anchor_cover /r:link //r:if_content/r:children:each This produces: Details— * Sienfeld Sienfeld (this has an anchor called #sienfeld) * Jerry Jerry (this has an anchor called #jerry) Hope this makes sense and does what you need. Cheers, Mohit. 3/17/2009 | 12:44 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] Index at top of page ??`
You could try this: * Create each bio page separately as you suggested I agree. This is a good way to go. * Create a special page part called 'anchor' in the bio page You could then write a special tag that creates a link to that anchor using r:children:each and a special tag similar to r:content called r:content_anchor that spits out the anchor in the HTML before doing the r:content for the child page? No need for an extra page part, you can just use the slug. For a page to pass as HTML valid, one of the requirements is that no two elements share the same id. Likewise, Radiant enforces that no two sibling pages have the same slug. Output the content like this: r:children:each div id=r:slug/ r:content/ /div /r:children:each And the index like this: r:children:each a href=#r:slug/r:title//a /r:children:each Cheers, Drew ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Index at top of page ??`
Andrew Neil wrote: You could try this: * Create each bio page separately as you suggested I agree. This is a good way to go. * Create a special page part called 'anchor' in the bio page You could then write a special tag that creates a link to that anchor using r:children:each and a special tag similar to r:content called r:content_anchor that spits out the anchor in the HTML before doing the r:content for the child page? No need for an extra page part, you can just use the slug. For a page to pass as HTML valid, one of the requirements is that no two elements share the same id. Likewise, Radiant enforces that no two sibling pages have the same slug. Output the content like this: r:children:each div id=r:slug/ r:content/ /div /r:children:each And the index like this: r:children:each a href=#r:slug/r:title//a /r:children:each That's good! I always get confused whether #r:slug / works! But I guess it does. Also, do div IDs work as anchors? Or should that be changed to: a name=r:slug / ... /a This really is much cleaner! No tags needed :) Cheers, Mohit. 3/17/2009 | 10:15 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] Index at top of page ??
Mohit Sindhwani wrote: Andrew Neil wrote: You could try this: * Create each bio page separately as you suggested I agree. This is a good way to go. * Create a special page part called 'anchor' in the bio page You could then write a special tag that creates a link to that anchor using r:children:each and a special tag similar to r:content called r:content_anchor that spits out the anchor in the HTML before doing the r:content for the child page? No need for an extra page part, you can just use the slug. For a page to pass as HTML valid, one of the requirements is that no two elements share the same id. Likewise, Radiant enforces that no two sibling pages have the same slug. Output the content like this: r:children:each div id=r:slug/ r:content/ /div /r:children:each And the index like this: r:children:each a href=#r:slug/r:title//a /r:children:each That's good! I always get confused whether #r:slug / works! But I guess it does. You can put radius tags wherever you want, except within other radius tags; that means you can set attributes to radius tags and have their output as the attriute's value in your HTML doc. Also, do div IDs work as anchors? Or should that be changed to: a name=r:slug / ... /a The name attribute does not exist in XHTML 1.1 and the id attribute works as an anchor, no matter what element it is with -- in XHTML it is universal. Thus, don't use the name attribute unless you need to stick with HTML4 -- dunno about HTML5, actually. Best Regards Chris ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Index at top of page ??
Christian Vetter wrote: That's good! I always get confused whether #r:slug / works! But I guess it does. You can put radius tags wherever you want, except within other radius tags; that means you can set attributes to radius tags and have their output as the attriute's value in your HTML doc. Thanks Christian, I'm always a bit fuzzy about some of these things till I use it :) Also, do div IDs work as anchors? Or should that be changed to: a name=r:slug / ... /a The name attribute does not exist in XHTML 1.1 and the id attribute works as an anchor, no matter what element it is with -- in XHTML it is universal. Thus, don't use the name attribute unless you need to stick with HTML4 -- dunno about HTML5, actually. Ah! That makes sense, thanks! Cheers, Mohit. 3/17/2009 | 1:35 PM. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant