Global Templates Synchronization

Good Afternoon

Again may question may seem to be amateurish, but I have been dealing with this issue for a while and hope to find a solution here

I am trying to synchronize a Global Template with Content Items within current folder and the Content Items in the subfolder

The Global Template attaches with no problem to any Content Item and any folder/subfolder but everything gets distorted after I publish the site. The paths/references to external resources (styles, images, scripts) are no longer valid in the published subfolder contents. I tried to create the second global template (dirty workaround) especially for the subfolder items with paths specifying one level up. It worked after I published but didn’t when previewing. The contents in the preview couldn’t find the resources. Of course I can place copies of the folder resources one level up for the preview, but it seems very unprofessional and not right to me?

So, here is my question

Is that possible somehow manage global template so it would access all resources during the preview and after publishing. Maybe there is a way in a JEXL to find the child of a global template and change the resources path according. Maybe there is another way or some standard way

I hope I made my question clear and, once again, thank you for your responses

Are you hard coding your paths to be relative? We use root relative links and that seems to work best for us. I assume that the “External Resources” are contained outside of Rhythmyx, so you may just want a static path to get to them. Maybe I am missing something here.

Publishing variables should do this for you. In the fast forward templates we set a binding for $rxs_navbase, the value of this is set up under the site definition in 6.7, a different value can be provided for each publishing context and site. In preview we often put these resources in the web_resources directory as a relative url, but the root path of this resource directory is usually a different folder when published. One thing to be careful of is if your css is referencing images or other resources, that it references them using a relative path e.g. …/images/background.jpg It will not work if the path starts with a domain or / as this will be different on preview and publish.