Jump to content

7.0 Avenue - make title of folder link to a page on click

Go to solution Solved by tuanphan,

Recommended Posts

I recently saw a post from years ago for a custom code option for a 7.0 site with the avenue theme. That particular forum post is archived and not able to take on any more comments, so I'm hoping there's someone who could help me with the same thing -

My client's site is https://www.jackmauch.com and it is live.

I would like to make the drop down folder called work  ("/work") link to an unlinked page called Portfolio Overview ("/portfolio-overview")

Then I would like to make the dropdown folder called Digital Processes ("digital-processes-folder") link to the page called Consulting ("digital-processes")

I realize these are two different things but if I could just get help with the first thing I will be so grateful. 


I have tried the two codes below with no luck. I removed each after it was clear they weren't working. 

Method 1:

Code injection header: 

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

code injection footer: 
<script>
  $(function() {
    $(".Header-nav-folder-title[href='/work']").attr('href', '/portfolio-overview');
  });
</script>

 

Method 2:

Code injection header: 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script> 
   $(document).ready(function() { 
     $('.Header-nav-folder-title[href="/work"]').attr("href", "/portfolio-overview");
   }); 
</script>

 

Please let me know if you might be able to help me! 

- Cami

Link to comment
  • Solution

You can use this code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(document).ready(function() { 
		$("nav.main-nav>ul>li:nth-child(1)>a").click(function() {
			var link = $(this).text(),
				href = "/portfolio-overview";
			window.location.href=href;
		});
});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.