Seppo Sahi wrote:
> Hi!
> 
> I have created following styles with Aegir.
> 
>   Styles for MyCo:
>    |
>    |-Welcome page
>    |
>    |-Sub page (dynamicnavi on left)
>       |-Two columns
>       |-Three columns
> 
> I would like to have "Welcome page" style on welcome page and different
> "Sub page (dynamicnavi on left)" variations on content pages. I use
> MidCOM AIS to assign different styles for topics/articles but seems like
> it does not have any effect. The site always uses the style that is
> defined in Aegir -> Websites -> MyCo web -> Details -> Style. I have
> checked out from Spider-Admin that style really gets updated.

If you're using Aegir and don't see the changes, remember to
flush/disable MidCOM cache of that site. This is just a precaution,
since AIS flushes it automagically and if you select the component style
in AIS it should be immediately visible.

Flushing is done by simply visiting the uri
www.example.net/midcom-cache-invalidate and you can check the settings
from www.example.net/midcom-admin/settings/ to disable the cache if
you're using a small site with low amount of visits or if the site isn't
yet in production and you're building it.

Then the next is to try to give some 'hello world' echoing on styles.
I'll go through the basics so that there is no part missed:

1) MidCOM styles that you choose for components are used only where the
style element <(content)> is used in either element <(ROOT)> or
elsewhere in style elements. This means that you can't override the
style you have determined for the site by selecting a style for the
component.

2) Remember that components use spesific style elements (eg.
'de.linkm.taviewer' uses element 'show-article' and
'de.linkm.newsticker' uses 'show-detail' for similar purpose) - if your
styles (eg. your 'Sub page') don't have the right elements, there will
be nothing to show. Depending on the component you need to have the
spesific style elements that you override. Besides having the newest,
MidCOM CVS has also list of component spesific elements
(http://midcom.tigris.org/ - which wasn't answering just a moment ago...)

3) If you're certain you have done things right so far, flush cache as
described above and disable it if necessary.

Since you're willing to have dynamic navigation on left side if _not_ on
the frontpage, you can make a small if statement. Depending on MidCOM
version, you have many alternatives. Here's two ways I'd do it:

// Slower, yet less error prone in sense of using suffixed site
// structure
if ($GLOBALS['midcom_site']['nap']->get_current_node() ===
$GLOBALS['midcom_site']['nap']->get_root_node())
{
    // Do things in here
}

// Faster, yet you might have to manually determine which $argv level is
// the right one. print_r($argv) to see what it has, it might be useful
// also in other places.
if (array_key_exists(0, $argv))
{
    // Do things in here
}

I'd also place this if statement in ROOT-element the site uses.

> Am I doing something wrong? or maybe misunderstund how styles should be
> used :)

I hope this helped. :)

> I'm quite new with Midgard and I really appreciate all help you can
> give! 

No problem.


-- 
Arttu Manninen

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to