Amruta Lonkar wrote:
Ok so i created a extensin file for rendering the referece information in the current article. I had a question will this be called even when the article is previewed and not actually saved?
Parser extensions are called whenever the parser encounters that extension. This is uncoditional to the destination or purpose of rendering (as long as it is a full rendering).
I have created a table called reference links similar to the imagelinks table. When a user enters his reference using an external link his reference gets entered into the reference table and in the textarea he can actually see the <ref>23</ref>, where the 23 is the refId from the reference table. I want to insert this info in the referencelinks table only when article is finally saved and not previewed. But when a user hits preview it should show actually pull up the reference name from the database and show that and similarly for preview.
Check the hooks ArticleSave and ArticleSaveComplete. Wait for those to be called before commiting data to the DB.
Also if i want to insert the info to be inserted in the referencelinks table can i do it before i do the rendering in the extension file istelf or will i still need to use hooks?
No. The HTML for an extension must be returned to the parser at the time of the call. And you can not be sure what data would need to be changed before the parser has completed parsing extensions and calling them.
-- Jamie ------------------------------------------------------------------- http://endeavour.zapto.org/astro73/ Thank you to JosephM for inviting me to Gmail! Have lots of invites. Gmail now has 2GB.