I want

<?php } ?>
<?php if (isset($this->request->get['route']) && $this->request->get['route'] == 'information/contact') { ?>
		$('#tab_contact').addClass('selected');
<?php } ?>

to replace <a href="<?php echo $wishlist; ?>" id="wishlist_total"><?php echo $text_wishlist; ?></a> How can i do this?

WAY too few details to work with, try writing down again what your precise goal is, and it's results.
The way it looks now, is that you want to generate Javascript to change a link filled in by PHP.

If so, just use getELementById in your javascript. php is already done by the time JScript begins

I am completely new to php and i don't understand what you have just said.

You want to set a menu section as active if a certain page is open? Well, you do know that you need to wrap that jquery part with <script></script> tags, right? Also, check that route var output to see if it's correct.

So are you suggesting i do it this way:

<script>
<?php } ?>
<?php if (isset($this->request->get) && $this->request->get == 'information/contact') { ?>
$('#tab_contact').addClass('selected');
<?php } ?>


</script>

or what?

<?php } ?>
<?php if (isset($this->request->get['route']) && $this->request->get['route'] == 'information/contact') { ?>
<script>
$(function() {
$('#tab_contact').addClass('selected');
});
</script>
<?php } ?>

more like this

Thank you Buppy

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.