Hi Nathan

Here is my untested solution.  

Assuming <[code-global]> or <[code-init]> contains a url parser like in Nemein Navbar, you should be able to put some logic in the ROOT style which executes the code stored in the topic's code field which in turn would contain a call to the appropriate style element:

Put the following in the ROOT style:

if ($topic) { 
    mgd_eval ($topic->code);
} elseif ($article){
    $article_topic = mgd_get_topic($article->topic);
    mgd_eval ($article_topic->code);
} else {
    ?><(content)><?
}

Then in each topic, call the appropriate topic style from the $topic->code field
<(topic_style_44)>

Layout each topic style as you would any style and somewhere in it, call the content element:
<(content)>

Cheers
James


Nathan Brown wrote:
Message
Hello,
 
I am attempting to set a style on a per topic and article basis. I have set a parameter of domain = 'Template', name = 'style' and value = '33' (Style Id associated to this specific topic or article).
 
Although unsuccessfuly I attempted to modify the root midgard object ($midgard->style = $styleId) and set the id to whichever style I want to use for that topic. This does not seem to change the loaded style or style elements to the overriden value.
 
Is there an existing way to override the default style attached to the page to be sourced from the topic or article? If not, any ideas how I may acomplish this?
 
/Nathan

Reply via email to