Link a Category to another url | Community
Skip to main content

Link a Category to another url

  • May 9, 2014
  • 49 replies
  • 0 views

Show first post
This topic has been closed for replies.

49 replies

  • May 10, 2016

ModeratorWes

@Mike - Can you make sure that you have the code in place and which category are you trying to link.

 


  • May 10, 2016

It is the category titled CMS


ModeratorWes

@Mike - Is that category hidden as I don't see it from my end.


  • May 10, 2016

Should be visible now I just reorder them so it should be the second on in the list now. 


ModeratorWes

@Mike - I see it now, can you remove my code and let me play around with the URL


  • May 10, 2016

Done


ModeratorWes

@Mike - I have a live chat widget enabled here.  To speed things up can we chat there and then I can post back the solution as the code is interferring with the code that you have in place for your images.


ModeratorWes

@Mike give this a try.

$('a').each(function() {
var value = $(this).attr('href');
if(value=='/hc/en-us/categories/200108526-Technical')
{
$(this).attr('href', 'http://google.com');
$('ul.category-list > li > a[href*="201274123"]').prepend($ScreenBeamCMS + "<br />");
}
});

Remove the code at the bottom of your script starting on line 129.


  • May 11, 2016

Wes,

Your the best thanks for the help once again 

 

Mike


  • October 21, 2016

Hi Mike,

 

I'm trying to link a section to a URL that link a pdf in our cms.

I was trying to use the code below but didn't work:

$(document).ready(function() {:

//Point Category to external link

$("ul.section-list li a:contains('Developer Guidelines')").replaceWith('<a href="http://flowsystems.com.au/governance/Land_Housing/Developer_Infrastructure_Works_Guidelines.pdf">Developer Guidelines</a> ');

Can you help me please?

Thank you


  • October 25, 2016

Ciro, 

Wes is the one who gave me the help on making this work. He might be able to answer your question better than I. 

Mike


  • October 25, 2016

Hi Wes, 

can you help me with that?

I'm trying to link a section to a URL that link a pdf in our cms.

I was trying to use the code below but didn't work:

$(document).ready(function() {:

//Point Category to external link

$("ul.section-list li a:contains('Developer Guidelines')").replaceWith('<a href="http://flowsystems.com.au/governance/Land_Housing/Developer_Infrastructure_Works_Guidelines.pdf">DeveloperGuidelines</a> ');

Thank you 

 

Ciro


ModeratorWes

@Ciro - Am I able to get to your HC if so please provide a link and have the code in place.  Also there shouldn't be a semi ":" after your $(document).ready(function() {


  • October 27, 2016

@Wes, 

Here the HC: https://askus.flowsystems.com.au/hc/admin/appearance#editor

The code is at the end of the js section.

thank you very much

 


ModeratorWes

@Ciro - It looks like you have some kind of mobile re-direct so I'm unable to see the full Help Center site.  I can't be of much help unless I can see your Help Center.  Its best to make your site responsive and get rid of the mobile as you can't really edit the mobile version with CSS or JS. 


I have the same question as Kristen, but didn't see any resolution posted for her.

I want a section container to link to a specified URL.

I am using the Copenhagen theme.

Please help!


ModeratorWes

@Kimberly - You want a section to point to a specified URL from the Home Page or Category Page or both.

 


@Wes

The homepage – our sections are kind of displayed like categories.

Support.booksamillion.com


ModeratorWes

You can actually do this now with the curlybar framework which I would recommend using instead of JQUERY.  I have similar code here but we could do something very similar with the sections.  Give me a little more details and I'll see what I can do.l


Great! Thanks so much! You can email me if that would be easier.


ModeratorWes

@Kimberly - Can you join my SLACK channel and post your Home Page code and let me know what section you are wanting to point to what URL.

https://moderatorwes.signup.team/

Once we are done I'll post back the final code revision here for everyone's benefit that way we don't junk up the community with a bunch of code snippets.


  • March 10, 2017

Hi Wes Drury,

 

I am facing a similar error, but I am not able to redirect my category.

What I want is that when I click on my Category's icon/space It should redirect to some other page..

$("ul.category-list li a:contains('test')").replaceWith('<a href="www.google.com"> test</a> ');

 

Please have a look if I am doing something wrong, or ask for more info if you require


ModeratorWes

@nishant - What theme are you using as I have code located here that doesn't use JQUERY if you are using the Copenhagen theme.