It is hard to pinpoint the issue from the description - one way to get close to a fix could be this:
- Save the html of a generated page to a local file
- Make that page work (being outside the CMS this should be trivial)
-
Implement the needed changes in your CMS page or template - or post details here of what the CMS seeminsly "ate"