Re: [Radiant] Conditional Tags
On 06/03/2009, at 12:32 AM, Anton Aylward wrote: Elle Meredith said the following on 03/05/2009 01:54 AM: In most cases, I completely agree with you Mohit :). However, in this case, the layout is exactly the same: one #main column, one #sidebar -- I only want to hide h1 heading on the home page. If you do as I do and build your layouts as a collection of snippets then you can either have a front page layout that differs very slightly or hide the optional heading in a more general and thus reusable snippet. DRY. Hi Anton, I am a fan of snippets -- so I completely agree there. OK, layout is the go Cheers, Elle ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Conditional Tags
Anton Aylward wrote: Elle Meredith said the following on 03/05/2009 01:54 AM: In most cases, I completely agree with you Mohit :). However, in this case, the layout is exactly the same: one #main column, one #sidebar -- I only want to hide h1 heading on the home page. If you do as I do and build your layouts as a collection of snippets then you can either have a front page layout that differs very slightly or hide the optional heading in a more general and thus reusable snippet. DRY. Oh, that's so good! :) Cheers, Mohit. 3/5/2009 | 10:20 PM. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Conditional Tags
Elle Meredith said the following on 03/05/2009 01:54 AM: > In most cases, I completely agree with you Mohit :). However, in this > case, the layout is exactly the same: one #main column, one #sidebar > -- I only want to hide h1 heading on the home page. If you do as I do and build your layouts as a collection of snippets then you can either have a front page layout that differs very slightly or hide the optional heading in a more general and thus reusable snippet. DRY. -- "...Then anyone who leaves behind him a written manual, and likewise anyone who receives it, in the belief that such writing will be clear and certain, must be exceedingly simple-minded..." -- Plato, _Phaedrus_ ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Conditional Tags
Elle Meredith said the following on 03/04/2009 11:31 PM: > Could you suggest best practice to achieve the above? No. There is no such thing a a "Best Practice". Its a nonsense term invented by the Big Four and reeks of arrogance, the idea that there is one Supreme "ne plus ultra" method, which of course they will show you after you've paid them much dollars. However there are many exceedingly good and exceedingly efficacious practices. And yes, we should put more of them in the Wiki. My layouts look something like this: http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> http://www.w3.org/1999/xhtml"; xml:lang="en"> Well, that could even be a snippet, couldn't it? Factor out whenever you can. And my layout01-head snippet looks like Note that It means each page can have some custom meta or stylesheet or whatever it needs to be stuffed in the section. You might want to wrap that in a -- I thought about being born again, but my mother refused. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Conditional Tags
Elle Meredith wrote: On 05/03/2009, at 4:19 PM, Mohit Sindhwani wrote: 1. In my Normal layout I use the page title as h1 element (sometimes as a link, sometimes as just a heading). However, I wish _not_ to have a h1 title on the home page only. I am not sure how to achieve this. Hi Elle, I'm not going to answer your question :) My strong recommendation would be to have a different home page layout. The reason for this is that in most cases, the home page is completely different in the way that other pages are done. You would save yourself a lot of conditional stuff if you just separated that out. Of course, your question is still relevant for other reasons and I hope you get an answer (I'll take a look at the details later myself). In most cases, I completely agree with you Mohit :). However, in this case, the layout is exactly the same: one #main column, one #sidebar -- I only want to hide h1 heading on the home page. After reading your email, I would actually be really happy if there was a tag such as because then I could use if as: And then I can use the body.page_xxx to hide my title as well as control other page specific aspects while still using just one layout. You could write a tag for page_id. I posted once a tag for modified_by - you could just adapt it from there. This may help: http://lists.radiantcms.org/pipermail/radiant/2009-January/012132.html Cheers, Mohit. 3/5/2009 | 3:58 PM. ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Conditional Tags
On 05/03/2009, at 4:19 PM, Mohit Sindhwani wrote: 1. In my Normal layout I use the page title as h1 element (sometimes as a link, sometimes as just a heading). However, I wish _not_ to have a h1 title on the home page only. I am not sure how to achieve this. Hi Elle, I'm not going to answer your question :) My strong recommendation would be to have a different home page layout. The reason for this is that in most cases, the home page is completely different in the way that other pages are done. You would save yourself a lot of conditional stuff if you just separated that out. Of course, your question is still relevant for other reasons and I hope you get an answer (I'll take a look at the details later myself). In most cases, I completely agree with you Mohit :). However, in this case, the layout is exactly the same: one #main column, one #sidebar -- I only want to hide h1 heading on the home page. After reading your email, I would actually be really happy if there was a tag such as because then I could use if as: And then I can use the body.page_xxx to hide my title as well as control other page specific aspects while still using just one layout. I found this: http://www.mail-archive.com/radiant@radiantcms.org/msg02969.html so, using the conditional extension I could use: But, any chance this is now part of Radiant? I had a quick look at standard_tags.rb but couldn't see it. Actually, have my answer for q1. I used: Cheers, Elle ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
Re: [Radiant] Conditional Tags
Elle Meredith wrote: Hello, I've got a question regarding conditional tags. There are two things I would like to do: 1. In my Normal layout I use the page title as h1 element (sometimes as a link, sometimes as just a heading). However, I wish _not_ to have a h1 title on the home page only. I am not sure how to achieve this. Hi Elle, I'm not going to answer your question :) My strong recommendation would be to have a different home page layout. The reason for this is that in most cases, the home page is completely different in the way that other pages are done. You would save yourself a lot of conditional stuff if you just separated that out. For example, I have a site that I'm working on. The home page is: http://www.t-engine.info/ but internal pages are in a different layout and use things like bread crumbs, sidebar sections, etc. Even the main horizontal menu just below the header is not present in the home page since it offers those options as a main thing. http://www.t-engine.info/en/spec/ut-kernel/1.01/functions/task_management/tk_cre_tsk/ Of course, your question is still relevant for other reasons and I hope you get an answer (I'll take a look at the details later myself). ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
[Radiant] Conditional Tags
Hello, I've got a question regarding conditional tags. There are two things I would like to do: 1. In my Normal layout I use the page title as h1 element (sometimes as a link, sometimes as just a heading). However, I wish _not_ to have a h1 title on the home page only. I am not sure how to achieve this. On the wiki, I've seen an example: which matches the home page -- just not sure how to use it Currently in Normal Layout I have: Furthermore, using the above, when I go to archives, I get all the posts' titles but not a general %Y Archives heading. 2. There are a few styles I would like to apply to a certain page -- but I don't want to create another layout just for one page. I would prefer to be able to add a class to the body element instead and to be able to be more specific in my css. For example: if page_id = some_number add class="some_class" end or if page_title = some_title add class="some_class" end Could you suggest best practice to achieve the above? Thanks, Elle ___ Radiant mailing list Post: Radiant@radiantcms.org Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant