Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: users

need advice about two OC's that share utility template

 

 

Bricolage users RSS feed   Index | Next | Previous | View Threaded


k.rudnik at gmail

Oct 1, 2009, 4:34 AM

Post #1 of 3 (193 views)
Permalink
need advice about two OC's that share utility template

Hi,

I've defined 2 OC's: Web and  Category_Story_List (CSL OC) .
My Cover stories  go through both of them.
In Web OC  regular html pages are generated.
In CSL OC a php code is generated (list of  links to last stories in a
category).
This code is later included in various pages on the server side.
Utility template /util/story_list.mc (defined as Web OC utility
template) is used in both OC's so I had to select Web OC in Template
Includes section in the definition of CSL OC.
There are two /cover.mc templates - one for each OC.

The problem is that whenever I define a new (Web OC) /xxx/cover.mc in
a subcategory I have to clone CSL OC version of cover.mc in this
subcategory as well.

It is hard to remember about this dependency and I feel that there is
something wrong with the whole idea.


Should I define separate OC (CommonUtilities OC) to "hold" common
utility templates (like story_list.mc) and include these templates in
other OCS's (-- I feel I should't)

What is the clever way to get the result I need.

thanks in advance

Krzysztof


paulo at digitalcraftsmen

Oct 1, 2009, 5:02 AM

Post #2 of 3 (183 views)
Permalink
Re: need advice about two OC's that share utility template [In reply to]

OCs have the concept of inheritance so an OC can include the templates of
another OC. We have a utility OC that is included into our HTML and XML OCs
in order to do validation and encoding tasks common to both. This is
exactly what the "template includes" was designed for.

regards,

Paul


Krzysztof Rudnik wrote:
> Hi,
>
> I've defined 2 OC's: Web and Category_Story_List (CSL OC) .
> My Cover stories go through both of them.
> In Web OC regular html pages are generated.
> In CSL OC a php code is generated (list of links to last stories in a
> category).
> This code is later included in various pages on the server side.
> Utility template /util/story_list.mc (defined as Web OC utility
> template) is used in both OC's so I had to select Web OC in Template
> Includes section in the definition of CSL OC.
> There are two /cover.mc templates - one for each OC.
>
> The problem is that whenever I define a new (Web OC) /xxx/cover.mc in
> a subcategory I have to clone CSL OC version of cover.mc in this
> subcategory as well.
>
> It is hard to remember about this dependency and I feel that there is
> something wrong with the whole idea.
>
>
> Should I define separate OC (CommonUtilities OC) to "hold" common
> utility templates (like story_list.mc) and include these templates in
> other OCS's (-- I feel I should't)
>
> What is the clever way to get the result I need.
>
> thanks in advance
>
> Krzysztof
>


k.rudnik at gmail

Oct 1, 2009, 5:12 AM

Post #3 of 3 (183 views)
Permalink
Re: need advice about two OC's that share utility template [In reply to]

On Thu, Oct 1, 2009 at 2:02 PM, Paul Orrock <paulo[at]digitalcraftsmen.net> wrote:
> OCs have the concept of inheritance so an OC can include the templates of
> another OC. We have a utility OC that is included into our HTML and XML OCs
> in order to do validation and encoding tasks common to both. This is exactly
> what the "template includes" was designed for.
So I was wrong when thinking about OC only as a pipe that output goes through.
OK than.
thanks very much
Krzysztof

>
> regards,
>
> Paul
>
>
> Krzysztof Rudnik wrote:
>>
>> Hi,
>>
>> I've defined 2 OC's: Web and  Category_Story_List (CSL OC) .
>> My Cover stories  go through both of them.
>> In Web OC  regular html pages are generated.
>> In CSL OC a php code is generated (list of  links to last stories in a
>> category).
>> This code is later included in various pages on the server side.
>> Utility template /util/story_list.mc (defined as Web OC utility
>> template) is used in both OC's so I had to select Web OC  in Template
>> Includes section in the definition of CSL OC.
>> There are two /cover.mc templates - one for each OC.
>>
>> The problem is that whenever I define a new (Web OC) /xxx/cover.mc in
>> a subcategory I have to  clone CSL OC version of cover.mc in this
>> subcategory as well.
>>
>> It is hard to remember about this dependency and I feel that there is
>> something wrong with the whole idea.
>>
>>
>> Should I define separate OC (CommonUtilities OC)  to "hold" common
>> utility templates (like story_list.mc) and include these templates in
>> other OCS's (-- I feel I should't)
>>
>> What is the clever way to get the result I need.
>>
>> thanks in advance
>>
>> Krzysztof
>>
>

Bricolage users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.