[Resolved] I would like to open a layout tab from a link on another page
The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 6 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.
Because the IDs change with every page load it is not possible to link to a particular tab from a different page because it is impossible to anticipate what the id will be when the link is followed and the page then loads.
If this was a must-have then you would need a slightly more elaborate solution. Your links on the first page would need to include a URL parameter to pass which tab is required to the target page (e.g. site.com/the-linked-page/?tab=3) and then on the target page add some jQuery that, when the page loads, looks for the existence of the tab parameter, and if present triggers updating the tabs, much like in the post you linked to.
Is that something you are able to write? It's outside of our support policy to write such custom code but if you need help and I have time I'll come back to it.
Thanks for pointing me in the right direction. It may not be super elegant but I have a workable solution:
jQuery(document).ready(function($){
$('#myModal').on('shown.bs.modal', function () {
$('#myInput').focus();
});
// To open the 2nd tab
$('.tb_1_btnyes').click(function(){
jQuery('.nav-tabs li:eq(1) a').click();
});
function GetURLParameter(sParam){
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++)
{
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam)
{
return sParameterName[1];
}
}
}
if (GetURLParameter('tickets')=='book'){
/*alert(GetURLParameter('tickets'));*/
jQuery('.nav-tabs li:eq(1) a').click();
}
});
example: hidden link
I did have a plugin clash which caused tab content to repeat below, I still have to debug that but pleased it works, thanks!
Derek
The forum ‘Types Community Support’ is closed to new topics and replies.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.