You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write an extension that parses the content of a page, generates some data, then passes the object into the data available to the page templates. Is that possible?
The use case is that I'm trying to generate a content outline as a nested structure, then pass that data on to the template which can render it as an on-page table of contents. I'm not looking for a ToC generating plugin; I've looked at those and they generate the markup for you, which I don't want -- not flexible enough. (But if I've missed a ToC plugin that just generates raw data for the template, I am interested in that!)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to write an extension that parses the content of a page, generates some data, then passes the object into the data available to the page templates. Is that possible?
The use case is that I'm trying to generate a content outline as a nested structure, then pass that data on to the template which can render it as an on-page table of contents. I'm not looking for a ToC generating plugin; I've looked at those and they generate the markup for you, which I don't want -- not flexible enough. (But if I've missed a ToC plugin that just generates raw data for the template, I am interested in that!)
Beta Was this translation helpful? Give feedback.
All reactions