Templates: category, Section, Article, Community Post
Hi to all,
Here, I am sharing a simple tip that if anybody need in urgent call like middle of the customization project so he/she can use this. The given regex can be used to get the IDs from the breadcrumbs and user can check the IDs with 'if' condition and do something using JS, etc.
To get category ID from breadcrumbs.
var getID = $('.breadcrumbs li:nth-child(2) a').attr('href').match(/[0-9]+/)
To get section ID from breadcrumbs.
var getID = $('.breadcrumbs li:nth-child(3) a').attr('href').match(/[0-9]+/)
The above script code need to add on the template inside the script tags.
There are another ways to get the IDs by search-bar as in my previous post and this one is also from those ways :)
댓글을 남기려면 로그인하세요.