close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Add "active" class

Thread begun 1/27/2023 10:34 pm by Raza | Last modified 2/14/2023 8:16 am by Ray Borduin | 770 views | 8 replies |

Raza

Add "active" class

hello,
how are you? hope doing well. I want ask how to add Bootstrap class "active" to dynamic menu? I am attaching the code file
regard

Sign in to reply to this post

Ray BorduinWebAssist

It looks like you are already trying to with:

<?php if (stripos($_SERVER['REQUEST_URI'],'index.php') !== false) {?>active<?php } ?>

Where else did you want to add it? or what isn't working the way you want? I would think code similar to the code you have would work.

Sign in to reply to this post
Did this help? Tips are appreciated...

Raza

its applied on all menu

Sign in to reply to this post

Ray BorduinWebAssist

Maybe try:


<a class="nav-link <?php if (stripos($_SERVER['REQUEST_URI'],'index.php?name='.$Recordset1->getColumnVal("name")) !== false) {?>active<?php } ?>" aria-current="page" href="index.php?name=<?php echo($Recordset1->getColumnVal("name")); ?>">
<?php echo($Recordset1->getColumnVal("name")); ?>
</a>

Sign in to reply to this post
Did this help? Tips are appreciated...

Raza

sorry for late. its works Thanks but detail page showing same in each page I don't whats wrong in fact code is fine I am sending demo and code

Attached Files
20230202111500.mp4
index.php
Sign in to reply to this post

Ray BorduinWebAssist

It might be an issue with your .htaccess file not passing the correct name.... ad this to your page:

php:
Showing: <?php echo($_GET["page"]); ?>



If the name doesn't change, then it is probably an issue with your .htaccess

Sign in to reply to this post
Did this help? Tips are appreciated...

Raza

here is .htaccess code
RewriteEngine On
RewriteRule ^([a-zA-Z0-9-]+)?$ index.php?name=$1

Sign in to reply to this post

Ray BorduinWebAssist

That looks correct. I may need to help with this in a premier support ticket. I need to debug your code live to make sure I understand and can fix the problem and the forums won't allow that.

Sign in to reply to this post
Did this help? Tips are appreciated...

Raza

I will sort out it on my own

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...