another stumbling block

Discussion in 'HTML' started by John Salerno, Feb 9, 2006.

  1. John Salerno

    John Salerno Guest

    This is similar to my question about how to change things when using a
    PHP include. I'm using this markup for a navigation menu:

    <div id="navlist">
    <ul class="menu">
    <li id="uberlink"><a href="#">Home</a></li>
    <li><a href="#">Blog</a></li>
    <li><a href="#">Links</a></li>
    <li><a href="#">Page Four</a></li>
    <li><a href="#">Page Five</a></li>
    </ul>
    </div>


    To make the current page stay highlighted, you use the uberlink id. But
    this seems to suggest that you must put this markup in each page
    separately, and manually change the id each time (move it to Blog for
    that page, to Links for that page, etc.).

    I'd rather use a PHP include to insert this markup on each page, but how
    would I do that and also be sure that the proper element gets the id?
    John Salerno, Feb 9, 2006
    #1
    1. Advertising

  2. John Salerno

    Mark Parnell Guest

    Deciding to do something for the good of humanity, John Salerno
    <> declared in alt.html:

    > I'd rather use a PHP include to insert this markup on each page, but how
    > would I do that and also be sure that the proper element gets the id?


    Didn't you ask that the other day? Or was it someone else?

    <li<?php if(basename($_SERVER['PHP_SELF']) == 'location.php') {print('
    id="uberlink"');} ?>>Home</li>

    --
    Mark Parnell

    Now implementing http://blinkynet.net/comp/uip5.html
    Mark Parnell, Feb 9, 2006
    #2
    1. Advertising

  3. John Salerno

    John Salerno Guest

    Mark Parnell wrote:
    > Deciding to do something for the good of humanity, John Salerno
    > <> declared in alt.html:
    >
    >> I'd rather use a PHP include to insert this markup on each page, but how
    >> would I do that and also be sure that the proper element gets the id?

    >
    > Didn't you ask that the other day? Or was it someone else?
    >
    > <li<?php if(basename($_SERVER['PHP_SELF']) == 'location.php') {print('
    > id="uberlink"');} ?>>Home</li>
    >


    Yeah, I asked a similar question but I guess I don't know enough about
    PHP to really get this yet. I'll have to do some research on the line of
    code you gave above.

    Thanks!
    John Salerno, Feb 9, 2006
    #3
  4. John Salerno wrote:

    > Mark Parnell wrote:
    >
    >> Deciding to do something for the good of humanity, John Salerno
    >> <> declared in alt.html:
    >>
    >>> I'd rather use a PHP include to insert this markup on each page, but
    >>> how would I do that and also be sure that the proper element gets the
    >>> id?

    >>
    >>
    >> Didn't you ask that the other day? Or was it someone else?
    >>
    >> <li<?php if(basename($_SERVER['PHP_SELF']) == 'location.php') {print('
    >> id="uberlink"');} ?>>Home</li>
    >>

    >
    > Yeah, I asked a similar question but I guess I don't know enough about
    > PHP to really get this yet. I'll have to do some research on the line of
    > code you gave above.



    http://www.php.net/docs.php
    PHP: Documentation

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Feb 9, 2006
    #4
  5. John Salerno

    John Salerno Guest

    Mark Parnell wrote:
    > Deciding to do something for the good of humanity, John Salerno
    > <> declared in alt.html:
    >
    >> I'd rather use a PHP include to insert this markup on each page, but how
    >> would I do that and also be sure that the proper element gets the id?

    >
    > Didn't you ask that the other day? Or was it someone else?
    >
    > <li<?php if(basename($_SERVER['PHP_SELF']) == 'location.php') {print('
    > id="uberlink"');} ?>>Home</li>
    >


    Hmm, but what if I want to put the entire block of menu items into a PHP
    file and include() that in the HTML file? The above wouldn't work,
    because it still uses a page by page method.
    John Salerno, Feb 11, 2006
    #5
  6. John Salerno

    Mark Parnell Guest

    Deciding to do something for the good of humanity, John Salerno
    <> declared in alt.html:

    > Hmm, but what if I want to put the entire block of menu items into a PHP
    > file and include() that in the HTML file?


    That's what my post was intended for.

    > The above wouldn't work,
    > because it still uses a page by page method.


    Just put all the links together.

    <ul id="main-menu">
    <li<?php if(basename($_SERVER['PHP_SELF']) == 'location.php') {print('
    id="uberlink"');} ?>>Home</li>
    <li<?php if(basename($_SERVER['PHP_SELF']) == 'location2.php') {print('
    id="uberlink"');} ?>>Another Place</li>
    <li<?php if(basename($_SERVER['PHP_SELF']) == 'location3.php') {print('
    id="uberlink"');} ?>>Somewhere Else</li>
    <li<?php if(basename($_SERVER['PHP_SELF']) == 'location4.php') {print('
    id="uberlink"');} ?>>Yet Another Location</li>
    </ul>

    --
    Mark Parnell

    Now implementing http://blinkynet.net/comp/uip5.html
    Mark Parnell, Feb 14, 2006
    #6
  7. John Salerno

    John Salerno Guest

    Mark Parnell wrote:
    > Deciding to do something for the good of humanity, John Salerno
    > <> declared in alt.html:
    >
    >> Hmm, but what if I want to put the entire block of menu items into a PHP
    >> file and include() that in the HTML file?

    >
    > That's what my post was intended for.
    >
    >> The above wouldn't work,
    >> because it still uses a page by page method.

    >
    > Just put all the links together.
    >
    > <ul id="main-menu">
    > <li<?php if(basename($_SERVER['PHP_SELF']) == 'location.php') {print('
    > id="uberlink"');} ?>>Home</li>
    > <li<?php if(basename($_SERVER['PHP_SELF']) == 'location2.php') {print('
    > id="uberlink"');} ?>>Another Place</li>
    > <li<?php if(basename($_SERVER['PHP_SELF']) == 'location3.php') {print('
    > id="uberlink"');} ?>>Somewhere Else</li>
    > <li<?php if(basename($_SERVER['PHP_SELF']) == 'location4.php') {print('
    > id="uberlink"');} ?>>Yet Another Location</li>
    > </ul>
    >


    Oh! Geez, I really need a PHP book... :)
    John Salerno, Feb 14, 2006
    #7
  8. John Salerno wrote:

    > Mark Parnell wrote:
    >
    >> Deciding to do something for the good of humanity, John Salerno
    >> <> declared in alt.html:
    >>
    >>> Hmm, but what if I want to put the entire block of menu items into a
    >>> PHP file and include() that in the HTML file?

    >>
    >>
    >> That's what my post was intended for.
    >>
    >>> The above wouldn't work, because it still uses a page by page method.

    >>
    >>
    >> Just put all the links together.
    >>
    >> <ul id="main-menu">
    >> <li<?php if(basename($_SERVER['PHP_SELF']) == 'location.php') {print('
    >> id="uberlink"');} ?>>Home</li>
    >> <li<?php if(basename($_SERVER['PHP_SELF']) == 'location2.php') {print('
    >> id="uberlink"');} ?>>Another Place</li>
    >> <li<?php if(basename($_SERVER['PHP_SELF']) == 'location3.php') {print('
    >> id="uberlink"');} ?>>Somewhere Else</li>
    >> <li<?php if(basename($_SERVER['PHP_SELF']) == 'location4.php') {print('
    >> id="uberlink"');} ?>>Yet Another Location</li>
    >> </ul>
    >>

    >
    > Oh! Geez, I really need a PHP book... :)


    I got some but many are pretty poor in IMHO, learned more from:

    http://www.php.net/docs.php
    PHP: Documentation

    (Wished PHP authors utilized more function arguments then so many dang
    core functions!)



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Feb 14, 2006
    #8
  9. John Salerno

    dorayme Guest

    In article <43f26864$0$25077$>,
    "Jonathan N. Little" <> wrote:

    > I got some but many are pretty poor in IMHO, learned more from:
    >
    > http://www.php.net/docs.php
    > PHP: Documentation
    >
    > (Wished PHP authors utilized more function arguments then so many dang
    > core functions!)


    I notice that in Safari, a Mac OS X browser, (but not in Firefox,
    not even in IE for Mac on 9) this page requires about 1800px wide
    to display the text in the contents section. The text won't wrap!
    I had to have it hanging out onto another screen beyond the 1600
    px of the main one to see all the para without scrolling. Have
    not investigated the cause... Safari is often very picky, what
    has it picked on here or is it broken in some respect?

    --
    dorayme
    dorayme, Feb 15, 2006
    #9
  10. John Salerno

    dorayme Guest

    dorayme wrote:

    > In article <43f26864$0$25077$>,
    > "Jonathan N. Little" <> wrote:
    >
    >
    >>I got some but many are pretty poor in IMHO, learned more from:
    >>
    >>http://www.php.net/docs.php
    >>PHP: Documentation
    >>
    >>(Wished PHP authors utilized more function arguments then so many dang
    >>core functions!)

    >
    >
    > I notice that in Safari, a Mac OS X browser, (but not in Firefox,
    > not even in IE for Mac on 9) this page requires about 1800px wide
    > to display the text in the contents section. The text won't wrap!
    > I had to have it hanging out onto another screen beyond the 1600
    > px of the main one to see all the para without scrolling. Have
    > not investigated the cause... Safari is often very picky, what
    > has it picked on here or is it broken in some respect?
    >


    Would everyone please stop investigating this right now. Jonathan, take
    that new Mac back to the store, there was no need... It was caused by a
    corrupted preference (probably) in my copy of Safari.
    dorayme, Feb 16, 2006
    #10
  11. dorayme wrote:

    > dorayme wrote:
    >
    >> In article <43f26864$0$25077$>,
    >> "Jonathan N. Little" <> wrote:
    >>
    >>
    >>> I got some but many are pretty poor in IMHO, learned more from:
    >>>
    >>> http://www.php.net/docs.php
    >>> PHP: Documentation
    >>>
    >>> (Wished PHP authors utilized more function arguments then so many
    >>> dang core functions!)

    >>
    >>
    >>
    >> I notice that in Safari, a Mac OS X browser, (but not in Firefox, not
    >> even in IE for Mac on 9) this page requires about 1800px wide to
    >> display the text in the contents section. The text won't wrap! I had
    >> to have it hanging out onto another screen beyond the 1600 px of the
    >> main one to see all the para without scrolling. Have not investigated
    >> the cause... Safari is often very picky, what has it picked on here or
    >> is it broken in some respect?
    >>

    >
    > Would everyone please stop investigating this right now. Jonathan, take
    > that new Mac back to the store, there was no need...


    What-what? What Mac? I was talking about PHP books! I don't have a Mac
    and as an artist that has to deal with Mac-centric printers, well don't
    get me started! ;-)

    http://superbasspond.com/turnakit/comedy/Apple_Switch_Parody_DivX.avi

    It was caused by a
    > corrupted preference (probably) in my copy of Safari.



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Feb 16, 2006
    #11
  12. John Salerno

    dorayme Guest

    In article <43f3d924$0$25072$>,
    "Jonathan N. Little" <> wrote:

    > > Would everyone please stop investigating this right now. Jonathan, take
    > > that new Mac back to the store, there was no need...

    >
    > What-what? What Mac? I was talking about PHP books! I don't have a Mac
    > and as an artist that has to deal with Mac-centric printers, well don't
    > get me started! ;-)
    >
    > http://superbasspond.com/turnakit/comedy/Apple_Switch_Parody_DivX.avi
    >
    > It was caused by a
    > > corrupted preference (probably) in my copy of Safari.


    It's ok Jonathan, I was imagining (because - sad to say - it
    amuses me), that everyone at alt.html runs about on my every word
    and problem, and that you, being one of the most helpful around
    here, would even go to the trouble of buying a Mac, getting
    Safari and seeing what prob I was alluding to...

    :)

    --
    dorayme
    dorayme, Feb 16, 2006
    #12
  13. dorayme wrote:

    <snip>
    > It's ok Jonathan, I was imagining (because - sad to say - it
    > amuses me),


    Imagination, yep it can be a good thing, just as long as it not
    delusion, oh but that politics! ;-)

    > that everyone at alt.html runs about on my every word
    > and problem,


    Hmm really? Pay no mind. Once and a while I will get irked but then I
    take a breath, reflect and try to move on.

    > and that you, being one of the most helpful around
    > here,


    <blush>

    Really it is just that I am procrastinating learning SQL for MySQL!

    > would even go to the trouble of buying a Mac, getting
    > Safari and seeing what prob I was alluding to...


    Actually you may know me too well! I have contemplated getting a use Mac
    for testing and debugging and all. Having custom built nearly all my
    PC's, (well lets see, the 8088's were bought but the first was a '286
    clone!) been frustrated when dealing with Mac-ites that when presented
    with a problem file or program -- that is it 'It cannot be done!'

    <duck and cover> sorry but that has been my experience!


    PC/MS combo was great challenge with all the little snafus that drove
    the hacking spirit! Should have gotten into Linux sooner, now I don't
    have the time, so I just get my servers up and running and forget them.
    I still haven't had time to test out a Fedora workstation to tryout
    Linux desktop...but if Vista turns out to be what I think it will and my
    Win2K becomes too obsolete well...


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Feb 16, 2006
    #13
  14. John Salerno

    dorayme Guest

    In article <43f3eb9e$0$25072$>,
    "Jonathan N. Little" <> wrote:

    > Actually you may know me too well! I have contemplated getting a use Mac
    > for testing and debugging and all. Having custom built nearly all my
    > PC's, (well lets see, the 8088's were bought but the first was a '286
    > clone!) been frustrated when dealing with Mac-ites that when presented
    > with a problem file or program -- that is it 'It cannot be done!'
    >
    > <duck and cover> sorry but that has been my experience!


    My experience has been that the Mac community is very helpful.
    There are not many files that a Mac cannot somehow open. If you
    want to have some fun, get a 7300 or 7600 or even a 9600
    Powermac, they are very easy to open and fiddle about with, are
    upgradeable and can be got for next to nothing. It is a cheapish
    hobby. There are some terrific Mac groups you can join to discuss
    issues...

    --
    dorayme
    dorayme, Feb 17, 2006
    #14
  15. In article <>,
    dorayme <> wrote:
    >In article <43f3eb9e$0$25072$>,
    > "Jonathan N. Little" <> wrote:
    >
    >> Actually you may know me too well! I have contemplated getting a use Mac
    >> for testing and debugging and all. Having custom built nearly all my
    >> PC's, (well lets see, the 8088's were bought but the first was a '286
    >> clone!) been frustrated when dealing with Mac-ites that when presented
    >> with a problem file or program -- that is it 'It cannot be done!'
    >>
    >> <duck and cover> sorry but that has been my experience!

    >
    >My experience has been that the Mac community is very helpful.
    >There are not many files that a Mac cannot somehow open. If you
    >want to have some fun, get a 7300 or 7600 or even a 9600
    >Powermac, they are very easy to open and fiddle about with, are
    >upgradeable and can be got for next to nothing. It is a cheapish
    >hobby. There are some terrific Mac groups you can join to discuss
    >issues...


    The fruit flavour iMacs sell for peanuts on craigslist. I picked up 2
    for $175. Great little things for spare ssh terminals.

    --
    Need Mercedes parts ? - http://parts.mbz.org
    Richard Sexton | Mercedes stuff: http://mbz.org
    1970 280SE, 72 280SE | Home page: http://rs79.vrx.net
    633CSi 250SE/C 300SD | http://aquaria.net http://killi.net
    Richard Sexton, Feb 17, 2006
    #15
  16. John Salerno

    dorayme Guest

    In article <dt3jhi$5kl$>,
    (Richard Sexton) wrote:

    > In article
    > <>
    > ,
    > dorayme <> wrote:
    > >In article <43f3eb9e$0$25072$>,
    > > "Jonathan N. Little" <> wrote:
    > >
    > >> ...I have contemplated getting a use Mac
    > >> for testing and debugging and all. Having custom built nearly all my
    > >> PC's, ...

    > >
    > >My experience has been that the Mac community is very helpful.
    > >There are not many files that a Mac cannot somehow open. If you
    > >want to have some fun, get a 7300 or 7600 or even a 9600
    > >Powermac, they are very easy to open and fiddle about with, are
    > >upgradeable and can be got for next to nothing. It is a cheapish
    > >hobby. There are some terrific Mac groups you can join to discuss
    > >issues...

    >
    > The fruit flavour iMacs sell for peanuts on craigslist. I picked up 2
    > for $175. Great little things for spare ssh terminals.


    That is exactly what you should not get if you want to have fun
    with the machine itself...

    --
    dorayme
    dorayme, Feb 17, 2006
    #16
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Showjumper
    Replies:
    1
    Views:
    703
    Showjumper
    Mar 19, 2005
  2. Noozer

    Block DIV within a block DIV?

    Noozer, Jan 6, 2005, in forum: HTML
    Replies:
    3
    Views:
    11,365
    Mitja
    Jan 6, 2005
  3. Andy
    Replies:
    0
    Views:
    532
  4. morrell
    Replies:
    1
    Views:
    949
    roy axenov
    Oct 10, 2006
  5. David Chelimsky

    yielding a block to another block

    David Chelimsky, Sep 2, 2006, in forum: Ruby
    Replies:
    4
    Views:
    91
    Eero Saynatkari
    Sep 3, 2006
Loading...

Share This Page