Thanks for the suggestion...

Just to confirm, is there no way in Mason to make a component call that
explicitly targets a specific component root?


On 3/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

one solution is to add a third comp root, that is one level up from the
fallback.

mason/asite/
mason/fallback/
mason/

then mason/asite/footer.mas can <& /fallback/footer.mas &>, and even
<%flags>inherit => /fallback/footer.mas<%/flags>

if you are uncomfortable with exposing <& /asite/foo &> from mason/bsite/,
you can get a similar effect by including a redundant directory in the
disk path to fallback, and using three comp roots like:

mason/asite/
mason/fallback/fallback/
mason/fallback/


> Hi,
>
> I have multiple component roots (two) for my sites.  One is a
> site-specific
> root and one is a "fallback" root that provides default components if
the
> site-specific root hasn't "overridden" them.
>
> For example, /footer.mas (in the fallback comp root) and /footer.mas (in
> the
> site-specific comp root).
>
> This works great if (a) the site doesn't have its own footer.mas defined
> (Mason uses the fallback one instead), and (b) the site has its own
> footer.mas that REPLACES the fallback footer (Mason uses the
site-specific
> one and the fallback is never called).
>
> However, I also want to support scenario (c) where the site has its own
> footer.mas that SUPPLEMENTS the fallback one.  For example, I have some
> site-specific stuff that I want to include (using the site's footer.mas)
> in
> addition to the fallback's footer.mas.
>
> To avoid circular references, then, I need a way to call the fallback's
> footer.mas from within the site-specific footer.mas.  Wondering if
there's
> a
> clean way to do this.  Something like:
>
> page.html:
> ---
> <& /header.mas &>
> ... content ...
> <& /footer.mas &>
> ---
>
> footer.mas:
> ---
> ... site-specific stuff ...
> <& /footer.mas &>    (here is where I want to say "use the fallback's
> footer.mas")
> ---
>
>
> Right now I'm working around case (c) by moving the site-specific
> footer.masto another folder:
>
> page.html:
> ---
> <& /header.mas &>
> ... content ...
> <& /site/footer.mas &>  (different path entirely to avoid the circular
> ref)
>
> (with the site-specific footer.mas the same as above).
>
> But, I'd rather not have to change my dozens of include paths if/when I
> decide to "override" one of the fallback components.
>
> (Note I'm just using header/footer includes as an example... I have lots
> of
> generic components that I occassionally want to override or augment
using
> the above technique.)
>
> Thanks!
>
-------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to