I have created my own component. When I add a new record to my component, I also want it to create a new article in joomla (i.e. using com_content).
I found this on stack overflow Programmatically adding an article to Joomla which explains how to do it. The code makes sense, and looks like it will work. The problem is that once methods start being called that are contained in com_content, all the relative URLs in com_content break down and joomla throws an error.
Does anyone know a way to overcome this? A comment from the link above suggests that changing the current working directory to the com_content one before including it will work, but I'm not 100% sure on how to do this.