[css-d] Controlling per-page nav contents
I apologize if this turns out to be more a PHP question, but is there a way to eclude a particular nav link on particular pages? the specific: prevent the Home page from having a text/nav element “Home” while the “Home” nav elements would be visible on all other pages. Thank you, John __ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Controlling per-page nav contents
Typically this is done with a class or id applies to a high level element, such as body class=home. Then, within your css, you can have: .home .nav .home-link { display: none; visibility: hidden; } On Tue, Feb 4, 2014 at 1:10 PM, John Johnson j...@coffeeonmars.com wrote: I apologize if this turns out to be more a PHP question, but is there a way to eclude a particular nav link on particular pages? the specific: prevent the Home page from having a text/nav element Home while the Home nav elements would be visible on all other pages. Thank you, John __ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ -- Chris Rockwell __ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Controlling per-page nav contents
On Tue, Feb 4, 2014 at 1:10 PM, John Johnson j...@coffeeonmars.com wrote: I apologize if this turns out to be more a PHP question, but is there a way to eclude a particular nav link on particular pages? the specific: prevent the Home page from having a text/nav element “Home” while the “Home” nav elements would be visible on all other pages. Thank you, John Normally, I just class a main wrapper (consistent on all pages) or the body element and attack it that way... .homepage nav a.home{display:none; visibility: none;} -- Tom Livingston | Senior Front-End Developer | Media Logic | ph: 518.456.3015x231 | fx: 518.456.4279 | mlinc.com __ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Controlling per-page nav contents
The original poster indicated he is generating his pages with PHP. Others since have shown how the home link could be hidden on the home page only using CSS rather than PHP. But the same result *could* be accomplished with server-side PHP logic. So perhaps the interesting question is Which avenue is better? CSS or server side scripting? Is there something about the CSS only approach that adds measurable value? On Tue, Feb 4, 2014 at 11:17 AM, Tom Livingston tom...@gmail.com wrote: On Tue, Feb 4, 2014 at 1:10 PM, John Johnson j...@coffeeonmars.com wrote: I apologize if this turns out to be more a PHP question, but is there a way to eclude a particular nav link on particular pages? the specific: prevent the Home page from having a text/nav element Home while the Home nav elements would be visible on all other pages. Thank you, John Normally, I just class a main wrapper (consistent on all pages) or the body element and attack it that way... .homepage nav a.home{display:none; visibility: none;} -- Tom Livingston | Senior Front-End Developer | Media Logic | ph: 518.456.3015x231 | fx: 518.456.4279 | mlinc.com __ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ -- /* Colin (Sandy) Pittendrigh --oO0 */ __ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Controlling per-page nav contents
On Tue, Feb 4, 2014 at 1:31 PM, Colin (Sandy) Pittendrigh sandy.pittendr...@gmail.com wrote: The original poster indicated he is generating his pages with PHP. Others since have shown how the home link could be hidden on the home page only using CSS rather than PHP. But the same result *could* be accomplished with server-side PHP logic. So perhaps the interesting question is Which avenue is better? CSS or server side scripting? Is there something about the CSS only approach that adds measurable value? Seeing this is a CSS list, I answered with CSS. I'm sure PHP can do this. Which is better? I don't technically know. -- Tom Livingston | Senior Front-End Developer | Media Logic | ph: 518.456.3015x231 | fx: 518.456.4279 | mlinc.com __ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Controlling per-page nav contents
I prefer to have the full navigation on all pages; if some links aren't relevant to the current context, they can be 'removed' with CSS. Additionally, especially with CMS's, caching of menu's is typical. If you did this with server side code, you would have to have a separate cache for each menu on each page. Doing it this way wouldn't necessarily result in a measurable performance hit, but it seems extraneous. On Tue, Feb 4, 2014 at 1:35 PM, Tom Livingston tom...@gmail.com wrote: On Tue, Feb 4, 2014 at 1:31 PM, Colin (Sandy) Pittendrigh sandy.pittendr...@gmail.com wrote: The original poster indicated he is generating his pages with PHP. Others since have shown how the home link could be hidden on the home page only using CSS rather than PHP. But the same result *could* be accomplished with server-side PHP logic. So perhaps the interesting question is Which avenue is better? CSS or server side scripting? Is there something about the CSS only approach that adds measurable value? Seeing this is a CSS list, I answered with CSS. I'm sure PHP can do this. Which is better? I don't technically know. -- Tom Livingston | Senior Front-End Developer | Media Logic | ph: 518.456.3015x231 | fx: 518.456.4279 | mlinc.com __ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ -- Chris Rockwell __ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Controlling per-page nav contents
On Tue, Feb 4, 2014 at 2:13 PM, Graham Hays graham.h...@visualcomputing.co.uk wrote: It would depend on why you want to not display a link .. with PHP the link is never displayed but with CSS it will still be displayed if the user turns off CSS, if the link is not essential then go with CSS. I usually still display the link (text) but not as a working link (I assume the reason is simply to prevent an unnecessary page load). Agreed. I've done this as well. On home page, home link is highlighted as the active page and isn't clickable. -- Tom Livingston | Senior Front-End Developer | Media Logic | ph: 518.456.3015x231 | fx: 518.456.4279 | mlinc.com __ css-discuss [css-d@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/