I've found a way by defining my own RenderModel implementation based on the
default RenderModelImpl class defined in the STK core module. I've simply
added a method, which calls MgnlContext to obtain what I need.

package //MyPackageName//;

import info.magnolia.cms.core.Content;
import info.magnolia.context.MgnlContext;
import info.magnolia.module.templating.RenderableDefinition;
import info.magnolia.module.templating.RenderingModel;
import info.magnolia.module.templating.RenderingModelImpl;

public class MyRenderingModelImpl extends RenderingModelImpl {

        public MyRenderingModelImpl(Content content,
                        RenderableDefinition definition, RenderingModel parent) 
{
                super(content, definition, parent);
        }
        
        public String getContextPath() {
                return MgnlContext.getContextPath();
        }
}


You then have to instruct your processed CSS to use this model class instead
of the default rendering model by. Use the Advanced tab of the dialog opened
when you edit the CSS in the Resources section of the Templating Kit menu.

Sounds a bit fishy, since a render model probably should be returning a
value like this. So is there a cleaner way to get the context path?

Thx
Andreas
-- 
View this message in context: 
http://www.nabble.com/Context-in-Processed-CSS-tp25457092p25457664.html
Sent from the Magnolia - User mailing list archive at Nabble.com.


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to