close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Active state

Thread began 4/29/2019 9:47 am by Jamie | Last modified 4/30/2019 1:03 am by Ray Borduin | 55 views | 3 replies |

Jamie

Active state

Hey Ray

Am trying to get an navigation 'active' state to work

On this page it works fine: https://clients.motley.site/dat/archives/purchases and if you toggle between purchases and projects the orange onstate is working.

Where it breaks down is if on either the purchases or projects page you go to an article, then both of the navigation points have the active state background showing rather than the one relevant to the article....not sure where its going wrong

Cheers

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

The FTP information doesn't seem to work for me. Was it changed?

Sign in to reply to this post

Jamie

Sorry. It's one of those accounts that you have to unlock the FTP - have done this now

Sign in to reply to this post

Ray BorduinWebAssist

The issue was with the php code that determines when to add the "active" class. You had:

php:
<?php echo(($_SERVER['REQUEST_URI']=="/dat/archives/".$SavingDorsetArchives->getColumnVal("Permalink") || $_SERVER['PHP_SELF']=="/dat/projectarchive.php" || $_SERVER['PHP_SELF']=="/dat/purchasearchive.php" || $_SERVER['REQUEST_URI']=="/dat/project/".$PageContents->getColumnVal("Permalink") || $_SERVER['REQUEST_URI']=="/dat/purchase/".$PageContents->getColumnVal("Permalink"))?"active":""); ?>


it needed to be:

php:
<?php echo(($_SERVER['REQUEST_URI']=="/dat/archives/".$SavingDorsetArchives->getColumnVal("Permalink") || $_SERVER['PHP_SELF']=="/dat/projectarchive.php" || $_SERVER['PHP_SELF']=="/dat/purchasearchive.php" || ($_SERVER['REQUEST_URI']=="/dat/project/".$PageContents->getColumnVal("Permalink") && $SavingDorsetArchives->getColumnVal("Permalink") == "projects") || ($_SERVER['REQUEST_URI']=="/dat/purchase/".$PageContents->getColumnVal("Permalink")) && $SavingDorsetArchives->getColumnVal("Permalink") == "purchases")?"active":""); ?>



Your IF statement was checking to see if it had a URI that matched purchase or project links, but it also had to check that you were currently displaying the associated section.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...