PHP "current page marker" dynamic menu of database?

Cannot get my head around this one. Anyone know how to add a "current page" marker to a menu item when the menu is generated dynamically in a database?

I currently have the underside, which offers the menu:

< ul >

<? PHP while ($row = $listNav-> fetch_assoc()) {? >}

< li > < a href = "index.php? pageNo = <?" PHP echo $row ['page_id'];? ' > '.

>

<? PHP echo $row ['page_title'];? > < /a > < /li >

<? PHP}? >

< /ul >

Which is this:

<ul >

"<li ><a href="index.php? pageNo = 1">home< /a >< /li > .

"<li ><a href="index.php? pageNo = 2">on< /a >< /li > .

"<li ><a href="index.php? pageNo = 3' >Our Vision< /a >< /li > .

"<li ><a href="index.php? pageNo = 4' >Contact< /a >< /li > .

< /ul >

What I need is the id = "currentPage" appear only when the requested page is perceived:

<ul >

"<li ><a href="index.php? pageNo = 1">home< /a >< /li > .

"<li ><a href="index.php? pageNo = 2" id ="currentPage">on< /a >< /li > "

"<li ><a href="index.php? pageNo = 4' >Our Vision< /a >< /li > .

"<li ><a href="index.php? pageNo = 3' >Contact< /a >< /li > .

< /ul >

I tried a few solutions, but everything I've tried so far has added id = "currentPage" to all links.

If I say something like below of course its 'true' if all the links get lidentifiant = "currentPage"; because of the php while loop.

<? PHP $thisPage = 'A comments';? >

"<li ><a href="index.php? pageNo = 2" "


<? PHP

If ($thisPage == "About") {}

echo "id ="currentPage;"

}

? >

> On< /a >< /li >

See you soon

Operating system

Solved with a little tweaking autour

    fetch_assoc()) {? >}

  • ">

    ID = "currentPage"

    >

Then dynamicaly to generate the css to match the $row ['page_id']

#currentPage {}

background-color: #09C;

}

Tags: Dreamweaver

Similar Questions

  • How to make the current page menu item displayed in a different font color?

    Hello

    My menu bar works very well. The links I get the text to hover display the desired color. Now I want the item menu of the selected page show a third color.

    With live-code activated in Dreamweaver CS6, I can see the following code is generated by the dynamic menu:

    "< script type =" text/javascript"src="/CatalystScripts/Java_DynMenusSelectedCSS.js "> < / script > <!-dynamic output CSS menu start-> < div id ="cat_549633_divs"> < ul id ="nav_549633">< class li ="selected"> < a href =" / home.html "> home < /a > < /li >< li > < a href =" "/ leistungen.html" > Services < /a > < /li > < li > < a href = "/ uhrenservice.html" > Uhrenservice < /a > < /li " "> < li > < a href =" / versteigerungen.html "> Versteigerungen < /a > < /li > < li > < a href =" / diamanten.html "> Diamanten < /a > < /li > < li > < a href =" / ueber_uns.html "" > Uber each < /a > < /li > < li > < a href = "/ kontakt.html" > Kontakt < /a > < /li > < /ul > < / div > < script type = "text/javascript" > catSetSelectedCSSItem ('nav_549633'); < /script > <! - end of output CSS Dynamic Menu - >

    The .selected class is created in the first element of the list (home) because it is the current page.

    And here is my CSS:

    {#nav_549633}

    float: right;

    list-style-type: none;

    padding-top: 5px;

    }

    #nav_549633 li {}

    float: left;

    text-align: left;

    }

    #nav_549633 li a {}

    color: white;

    text-decoration: none;

    margin: 27px 0 0 0;

    font size: 13px;

    text-transform: uppercase;

    }

    #nav_549633 Li a: hover {}

    color: yellow;

    }

    {.selected

    color: Green;

    }

    The green font color does not appear. It is still white.

    In order to see if the class 'works"I tried a few other attributes that work!

    {.selected

    color: Green;

    padding: 20px

    background-color: blue;

    }

    In this case, the item appears as a blue box with 20px padding, just as expected - but the font color is always white.

    Can someone help me?

    Kind regards

    Herman

    Hello Ginoem50,

    Looking at your css looks like the selected class does not work because the li #nav_549633 one is more specific is the one who is listened to.

    change .selected li.selected a #nav_549633 and it should work.

    Hope this helps,

    Chad Smith | http://bcgurus.com/Business-Catalyst-Templates for only $7

  • Enkitec Toolbar... Stop the menu items of the current page of derivative

    XE Summit 4.2 11.2

    Hi all.  Question today: I am using the Enkitec toolbar in my application. and everything works fine... except...

    Ive changed the application so the I have a series of reports that point to the same page to run a number of interactive reports with different settings...   They are grouped into a number of items in the submenu.

    However, the Enkitec menu is highlighting the current page. Like all items in menu 4 are all active page (or URL active), he sets them all to the same color blue., so instead of a list of menu with all the white background, I get a menu list when they are all blue...

    So Im trying to either disable the 'select the menu for the active page item' (easier) or somehow allow him to recognize that its actually a variant of the same page... (the settings are different...)

    Ive tried overiding the CSS with what I think is correct according to the how to on the web site Enkitec, but without success...

    If anyone could offer advice, Id be grateful...

    Kind regards

    Richard

    Hi Richard,

    Are you sure that's not because of the condition of the sub components?

    I'm sure you check 'in progress' through the list.

    Thank you

    -Jorge

  • set in docs book and indicate the current page of the marker number

    I have a book with multiple documents.  There are places in documents that I'll have to do State throughout the book (I'll call him these portions of the text 'X') with the mention "see page __."  I would like to put a marker in 'X' that contains the page number current of 'X '.  I would like to point out that the page number as variable as well as the position of 'X' Exchange, 'see page _' page number reference exchange as the position of 'X' is moving around I have add and subtract documents and text inside the book.

    I know that I can put "current page number" at the marker for 'X', but I do not know how to set the reference 'see page _' so she keeps track of the number of current page of 'X '.  That put the emptiness of "see page _ '?

    Help!  and thank you!

    Marilyn

    > they seem to only work as part of an index.

    Not since CS4. They are pretty well hidden in the help files.

    Look here: http://help.adobe.com/en_US/InDesign/6.0/WS9AD9A0DA-E10F-4d1e-9EB2-999FB61D21E8.html

  • New page is not opening in a new window when you use a dynamic menu

    I read a previous post about this, but I don't really see a solution that I could implement. I have a dynamic menu, and I want an article on it to open a new image. Here is the code to the module of the model.

    {module_menu, version = '2', '901683' = Flash, moduleTemplateGroup = "Default"}

    It's the menu main template of the Tribeca site template.

    I tried to insert (_blank) under appropriate destination, and again, it opens in the same window.  I got together at the previous post that it was a matter of version, but as you can see, the code says "version 2"... or I misread that?

    I could not find the place where to make changes. The previous post suggested I'm looking for the CSS on the style of home, but I'm not using a house model.

    Any thoughts?

    Chuck

    You don't put _blank in the module, and that's not all the. Module. There is a folder named models module and which is used by default menu layout. You must ensure or create the target for the link element attribute and add the tags.

    You then add your _blank in the area of the tag for target in admin.

  • Formatting of the Spry Menu to keep the current page has highlighted?

    Hello

    I have the manual missing O'Reilly for CS5, but I can't find instructions on how to keep the highlighted menu bar so that the user always sees the specific page they are on the menu. If someone chooses the "About" page, I would that the text/tab About stay highlighted (in the style of hover), so that the user always knows the page they are on (without adding a breadcrumb or separate page header).

    Can someone tell me the instructions. Is there a selector under specific within the spry css or separate it HTML I need to add to the html page or the menu js spry?

    Thank you

    Wendy

    Just follow the instructions here http://labs.adobe.com/technologies/spry/articles/updater_help/

    If you want a fast solution

    1. make a new (empty) file in the SpryAssets SpryDOMUtils.js file
    2. Click here http://labs.adobe.com/technologies/spry/includes/SpryDOMUtils.js
    3. copy the code that you see in step 2 (on the page, right click and select all of the pop-up)
    4. Open your newly created SpryDOMUtils.js file and paste the content in here (right click and choose Paste)

    And you have a copy of work. Don't forget to download the file on the remote server, otherwise your online version does not work.

    Happy vaporizing.

    Ben

    PS NEVER GIVE UP! There is always a solution.

  • "Use current Page" to save the Home/tab pages is gray, even though I have a new install of ver 22 without adding plugins or extensions. How can I fix it?

    When I try to save my pages / tabs, I can not, because this option is grayed out. I even uninstalled FF with Revo Uninstaller completely reinstalled without new plugins or extensions, and it remains greyed out. The only thing I can do is pin the tabs, but I wish to use this option. If I can't, I don't know whether its Firefox or malware or? Thanks in advance for any help. Windows 7 family Premium SP1, Firefox ver. 22

    Thank you very much for your time and effort. It was not the solution, but I couldn't find a place to close the ticket/request. I discovered that I had pinned tabs, in doing so, it grayed out this option. Once I have this marking tabs, I was able to use the option ' use current Page/s. Thanks again for responding so quickly.

  • Just a click away from the archives in the Wayback Machine of current page (JavaScript codes ask for bookmarklet)

    I wish, I can click a bookmarklet in the bookmarks bar to display the search results of the Wayback Machine for the current page. In other words, I wish that there may be a bookmarklet that opens at the following URL:

    http://wayback.archive.org/web/ * / URL_of_current_page

    I know I can drag a bookmarklet to the bookmarks bar and then his right - click on the Properties menu, change the text of the location to the JavaScript codes that opens the URL of the Wayback Machine above. I know nothing about programming.

    So, could someone help me with the necessary JavaScript code?

    Thank you.

    PS: I know that there are some add-ons that deals with WaybackMachine, such as 'Resurrect Pages' or 'Wayback Machine 20100602 ". But I have not found one that does what I want.

    javascript:{var%20url=location.href;void(window.open("http://wayback.archive.org/web/*/"+url));}
  • How to display dynamic menu with the parent and the child using c# and sql server

    Hello

    Can you tell me

    What is menu given Dynamics example

    How can u use my dynamic menu added project in c#

    This menu is display with only the data from sql database.

    Menu with the help of a parent node and a child.

    check the element all in sql server and adding one by a dynamic menu.

    Hello

    Thank you for writing to Microsoft Communities.

    I recommend you post your query in the following forum.

    http://social.msdn.Microsoft.com/forums/en/category/SQLServer/

    Hope this information is useful.

  • Problems printing multiple 'current page' range of documents.

    -Use of Word 2007 with a printer HP 1300 (Windows VISTA).
    -Select PRINT from the menu.
    -I am trying to print multiple copies of a page using "current page" to the print range.
    -I select the 'number of copies' and click OK, it will only print a copy.
    Which tried it:
    -J' typed in the number manually.
    -J' chose the number using the arrow.
    -J' I pressed ENTER, and I clicked OK
    Each time, just print a copy.

    Hi MaryVL,

     

    Welcome to Microsoft Answers Forums.

    We would like to get more information about you to help solve your problem. You better, please answer the following questions.

    ·         When was the last time it worked?

    ·         Remember to make changes to the computer recently?

    ·         You can print multiple copies using programs windows like Word pad or Notepad?

    First of all, I suggest that you try to print multiple copies using windows programs and check if you are facing similar problems.

    If you are facing this problem with Word 2007 suggest you try the steps in the Microsoft KB article below.

    You cannot print multiple copies of a Word 2007 document

    http://support.Microsoft.com/kb/918790

    If still cannot print multiple copies using Word 2007 suggest posting your question in the community of desktop application for more support.

    Discussions in Desktop Applications

    http://www.Microsoft.com/Office/Community/en-us/FlyoutOverview.mspx

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Export the current page - configuration

    Hello

    I created a page of dashboard with 8 reports on this subject.

    Some of these reports may have more than 25 results, so I get a menu drop-down:

    dropdown.jpg

    Now when I want to export the entire dashboard via the option page: 'Export to Excel - export current Page', I get the dashboard with all my reports, but only the first 25 results page.

    When I lay my lines manually in the report so I have all the lines on my screen, I also get them in my Excel export.

    I was wondering if there is a way to change this export feature, so it will export all results, not just those shown on the screen? (like normal export function on a single report)

    Thanks for your help,

    Sander

    Go to Edit dashboard - > print options-> print all lines (by default, this will be the visible lines).

    You can find this option in the dashboard menu which is located just after the option remove from the dashboard page (X symbol in red).

    Thank you

    AJ

  • INDD: Previous and current Page number in Master Pages.

    Hello

    I try to set the previous page and the current page number next to each other on each plate on the front of each plank. I want to add this in master pages.


    I have attached a picture of what I'm wanting - but for the moment it will only show the same number twice (even though I specified previous and current).

    Screenshot 2016-03-14 10.48.19.png

    Is there a way to do this?

    Thank you.

    There is a way to do that including InDesignSecrets.com Anne-Marie Concepcion. The problem is a little more complicated that you might expect:

    http://InDesignSecrets.com/PreviousNext-page-number-on-same-page.php

  • Why is there no menu of database in my Windows DW2015? [was: database]

    < removed blasphemy > DW 2015.i going crazy! why there is no menu of database in my Windows DW2015... I click on the windows, but there is no database there... ? What should I do? Please help me.

    They were withdrawn a few versions back because they were horribly outdated. There is no update of Adobe replacement project.

    You have a few options:

    If you continue to use CC 2015, you can purchase an extension (there are a few out there, such as DMX Zone) that creates the code to current standards, or learn to do it manually. Unfortunately, CC 2015 has a problem with installation of extensions currently that Adobe knows and works on.

    Probably the best option, for the short term, is to restore the previous version: How to find and install the previous Version of Adobe Apps in CC 2015 | Adobe Customer Care Team

    If I remember correctly, DWCS6 still has them.

  • External links in the dynamic menu created in Muse

    I'm editing a dynamic menu item to go to an external link instead of a built in Muse. How can I do this?

    Create a new model page, right-click on the thumbnail in the plan view, choose 'include the page without hyperlink '. Place a widget menu, select the entry and choose the command "Hyperlinks" in the strip of higher command to link to a page og your choice.

  • Mathematical calculation with the numbering of the current page

    Hello

    I am currently in a situation where I need 2 types of page numbers for a single page.

    delete.jpg

    To the right side, I use the current page number marker.

    Is there a way to make a mathematical calculation with number of current page on the left side?

    Something like 460 + current page number

    I can't use the data merge feature because all the page are already installed on.

    Kind regards.

    Hello

    You can run a script:

    app.findGrepPreferences = null;
    app.findGrepPreferences.findWhat = "~N";
    
    var
         FindGrep=app.activeDocument.findGrep(),
         len = FindGrep.length,
         item, pageNo, calcNo, rightSide,
         mDiff = 460;          // edit this value according to needs
    
         while (len-->0) {
              item = FindGrep[len];
              pageNo = item.parentTextFrames[0].parentPage.name;
              calcNo = parseInt(pageNo) + mDiff;
              item.paragraphs[0].contents = calcNo + "\t" + pageNo;
              rightSide = item.parentTextFrames[0].textFramePreferences.textColumnFixedWidth;
              with (item.paragraphs[0]) {
                   tabStops.add({alignment: TabStopAlignment.RIGHT_ALIGN, position: rightSide});
                   justification = Justification.LEFT_ALIGN;
                   }
              }
    

    that should work assuming management texts related with the pageNumbers are substituted (accessible)

    Jarek

Maybe you are looking for

  • Pavilion m7360y: RADEON X 600 series WDDM adapter stopped working

    For the past six weeks, using the Microsoft adapter Radeon X 600 series WDDM recommened, it's do not load properly & put my screen standby & causing 'hang up' or just crash my computer. I paid Microsoft $99 to solve this problem, if I had a suspiciou

  • wrt1900ac 2.4 ghz its downgrade my connection speed and 5 GHz not

    I experiment some downgrade ike ago one day, I tried to configure my router server disk external for use outside my network and now my connection on 2.4 ghz its downgrade 10 less and 5 GHz its good pop and stable

  • utilities

    Now, my laptop takes 4 minutes to complete startup. Several utilities advertise that they can speed up the process, but I tried several trial but have found nothing which seems to have improved the position. I disabled several programs that start at

  • How to install HP ink cartridges

    The following link is very useful to see how to install the HP ink for HP printers. Figure 1: Four cartridge systems Figure 2: Four cartridge systems Figure 3: Five cartridge systems Figure 4: Six cartridge systems Figure 5: Cartridge systems Figure

  • Turn off Power Edge 840

    Hi, I am now the proud owner of a Power Edge 840, but I can't figure out how to turn off without unplugging completely. Even if I disable IPMI, the power supply is always running and draining ~ 10W. Any ideas?