You can see the error in the menu in the right column (URL below). — Sorry for the inconvenience. We didn’t get where exactly. If possible can you please show us where exactly it is with the screenshot or small reference video? So that we will go through it and get back to you immediately.
Thread Starter
ironEd
(@ironed)
Screen shot is at the below link and I think within the last 30 min I solved 85% of the issue. I still have one problem.
https://iron10.ca/Morning_and_Evening_MBA_-_Rotman_Registrar’s_Office.jpg
What I think the issue is, is that the H2 tags — which I want to base the Table of Contents on — already have ID tags that someone before me hand-coded. Those ID attributes are inconsistently formatted. Your plugin is too polite and won’t replace those IDs (a tag can only ever have 1 ID).
So I wrote some JS to force the IDs to be consistent. I’ll put that at the end of this message in case someone else can make use of it.
The problem I still have is that when the anchor links are clicked and the page scrolls to the H2, the H2 isn’t offset from the floating header. It is ignoring the offset settings in your plugin. If you can give me a clue about how to resolve this, I would appreciate it.
-
This reply was modified 3 years, 7 months ago by
ironEd.
-
This reply was modified 3 years, 7 months ago by
ironEd.
-
This reply was modified 3 years, 7 months ago by
ironEd.
-
This reply was modified 3 years, 7 months ago by
ironEd.
-
This reply was modified 3 years, 7 months ago by
ironEd.
Thread Starter
ironEd
(@ironed)
Here’s that JS to force consistency on the Ids:
// force the Ids of the H2 tags to be consistently formatted so the sidebar menu works consistently
jQuery(function() {
const elHeadTwo= document.getElementsByTagName('h2');
// Iterate through the retrieved elements and add the necessary ID names.
for(var i = 0; i < elHeadTwo.length; i++)
{
var idText = elHeadTwo[i].innerHTML;
let resultOne = idText.replace(/ /gi, "-");
let resultTwo = resultOne.toLowerCase();
// sometimes an extra hyphen shows up at the end of the string. Cut it out.
let lastChar = resultTwo.at(-1);
if (lastChar==="-") {
const resultThree = resultTwo.replace(/.$/,"");
elHeadTwo[i].setAttribute("id", resultThree);
} else {
elHeadTwo[i].setAttribute("id", resultTwo);
}
}
}, false);
Thread Starter
ironEd
(@ironed)
Screen shot is at the below link and I think within the last 30 min I solved 85% of the issue. I still have one problem.
https://iron10.ca/Morning_and_Evening_MBA_-_Rotman_Registrar’s_Office.jpg
What I think the issue is, is that the H2 tags — which I want to base the Table of Contents on — already have ID tags that someone before me hand-coded. Those ID attributes are inconsistently formatted. Your plugin is too polite and won’t replace those IDs (a tag can only ever have 1 ID).
So I wrote some JS to force the IDs to be consistent. I’ll put that at the end of this message in case someone else can make use of it. (showed above this one b/c WordPress’s system flagged this msg 🙂 )
The problem I still have is that when the anchor links are clicked and the page scrolls to the H2, the H2 isn’t offset from the floating header. It is ignoring the offset settings in your plugin. If you can give me a clue about how to resolve this, I would appreciate it.
Thread Starter
ironEd
(@ironed)
Ok, I’ve discovered a fix for the “offset-the-header” issue. Add this to the CSS:
html
{
scroll-padding-top: 5vh; /* height of sticky header */
}
Sorry for the delay in getting back to you. We are getting the page not found URL in the given URL: https://prnt.sc/xNsc3CTkmeyW
Can you please check that once and send us the URL once? So that we will go through it and get back to you immediately.