Page 1 of 1

Anchor links in tabbed content with cms_selflink

Posted: Tue Oct 27, 2015 4:31 am
by cpansewicz
Hi,

Is it possible to set-up an internal anchor links on a page to tabbed content on another page using csm_selflink? (or at all for that matter?)

I was told this is not possible, but thought I would ask for a second opinion.

Thank you!

Re: Anchor links in tabbed content with cms_selflink

Posted: Tue Oct 27, 2015 8:22 am
by velden
Do you mean some automated way or just manual?

Re: Anchor links in tabbed content with cms_selflink

Posted: Tue Oct 27, 2015 3:11 pm
by cpansewicz
Manually is fine with me. I don't have that many instances of this.

If there is an automated way it would be interesting to know that out of curiosity.

Re: Anchor links in tabbed content with cms_selflink

Posted: Tue Oct 27, 2015 3:21 pm
by velden
Maybe I'm thinking too simple:

(CMSMS 1.12.1)

Code: Select all

{cms_selflink page="shadowmenu-tab-2-columns" dir=anchor anchorlink="anchor-test"}

Re: Anchor links in tabbed content with cms_selflink

Posted: Tue Oct 27, 2015 4:59 pm
by cpansewicz
Thank you. I do have them set up that way currently. The anchorlink will go to the correct page, but doesn't go to the location on the correct tab.

Re: Anchor links in tabbed content with cms_selflink

Posted: Tue Oct 27, 2015 5:19 pm
by calguy1000
You will need javascript to set that up. There is no 'standard' way of doing that.

On load you will need to test if there is a hash in the document.location
if there is:
- find that link
- find the parent tab of the link
- make the tab visible
- hide the other tabs
- scroll to the link

Re: Anchor links in tabbed content with cms_selflink

Posted: Tue Oct 27, 2015 6:17 pm
by cpansewicz
Ok. Thanks.