i have something in my mind but i dont know how to solve it.
i would like to parse the whole content and add an id attribute to all headers (no matter what type of (h1, h2, ...)) before content is displayed. i dont want to do this manually in wysiwyg.
WHY?
because i would like to show a table of contents (like wikipedia) at the beginning of a page and i want to send the parsed content to this udt so that the udt can create links to all headers.
the table of contents udt is the following:
http://wiki.cmsmadesimple.org/index.php ... f_contents
can somebody help me with that?
Adding an ID attribute to all headers in content
Adding an ID attribute to all headers in content
Last edited by SimonSchaufi on Mon Mar 02, 2009 11:13 am, edited 1 time in total.
Re: Adding an ID attribute to all headers in content
Could you use some kind of regex with smarty on the output?
I'm not that good with regex... but this could be a start - I think.
http://www.smarty.net/manual/en/languag ... eplace.php
Best
Nils
Code: Select all
{$foo|regex_replace:"pattern":" id=... "}
http://www.smarty.net/manual/en/languag ... eplace.php
Best
Nils
Re: Adding an ID attribute to all headers in content
need to think more about this idea...
any other ideas are welcome of course.
any other ideas are welcome of course.