Similar topics have been covered in this forum, but they’re either closed or over 3 years old.
My case may slightly differ from what’s been discussed here anyway.
I’m trying to link from a description (text-link) on a product page to open the respective, specific blog post page tab. It’s not working for me.
I copied the code provided posted below (exactly as is, no changes) to the site-wide footer custom code field.
I gave the tabs combo classes of “blog-tab-1”, “blog-tab-2” etc.
In the CMS of the respective product I added a text-link with the URL “https://ornament-is-crime.webflow.io/post?tab=blog-tab-1”
What am I doing wrong?
Is it the format of the URL that’s not working?
Can you please help?!
<script>
var Webflow = Webflow || [];
Webflow.push(function () {
var tabName = getParam('tab');
if (!tabName) return;
$('.' + tabName).triggerHandler('click');
function getParam(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
});
</script>
Do you want the link X2XOBF.ShouSugiBan in this example to link to a specific blog post?
It looks like you have tabs for blog posts on your blog page. Do you expect to update content in the products and blog posts regularly or is it going to be fairly static?
Only (some) text links in the product description will link to the respective blogs.
In that particular example you’re showing it would be the “Poplar” text link in the description and that should link to a specific tab (e.g. blog-tab-1) and open its content (which in this case is the blog post “Poplarism, Fairness in Taxation”).
To your other question:
The blog posts will be populated and edited by the client in the CMS. The content of the blog post may change but the post (the CMS item) will stay (meaning the link URL or tab class won’t change).
They will add more products (with links in the description) and more blog posts over time, but those will follow the same CMS and tab class pattern.
I found another solution in that I only use collection lists instead of tabs.
I’d still be curious to learn how to control the order of tabs vs tab content.