Re: [paginated-masters] Element master templates (was: planA/planB)

On 2/23/12 8:03 AM, "Håkon Wium Lie" <howcome@opera.com> wrote:

> Alan Stearns wrote:
... 
>> 4. (template using an explicit region slot)
>>    #content { overflow-style:paged-x; }
>>    #content > * { flow-into: content-flow; }
>>    @master-template {
>>      template-slots: main;
>>      <slot-syntax>(main) {
>>        flow-from: content-flow;
>>      }
>>    }
> 
> It's a noble goal to try to alingn mechanisms. And I kind of follow
> your code examples. But I don't understand what you try to do in (4):
> take all elements (including all text?) from #content and put them
> somewhere else? Or, is the use case to have the tex paginated, while
> the image are shown somewhere else? (The selector '#content > *' would
> select all <em> elements, too)

As I mentioned, the examples 2-4 would not actually be used unless you were
adding more slots to the template. This example just takes all the elements
of #content and puts it into a named flow, which is then flowed into an
explicit slot. It's an entirely-too-verbose way of expressing the same thing
as examples 1-3, but I wanted to introduce the idea of moving content to a
named flow and getting it into a template.

>> A simple header for each page:
>> 
>>    #content { overflow-style:paged-x; }
>>    @master-template {
>>      template-slots: header, content;
>>      <slot-syntax>(header) {
>>        content: "title string";
>>      }
>>      <slot-syntax>(content) { }
>>    }
> 
> What's the purpose of 'template-slots' -- to define an order for the slots?

It's both to create the slots and define an order.

>> A simple footer for each page:
>> 
>>    #content { overflow-style:paged-x; }
>>    @master-template {
>>      template-slots: content, footer;
>>      <slot-syntax>(content) { }
>>      <slot-syntax>(footer) {
>>        content: "author string";
>>      }
>>    }
> 
> If 'template-slots' define an order, chances are that the 'footer'
> slot will get some content flowed into it. What will happen with
> "author string" then?

In this example the footer slot only gets the generated content from its
content property. 

>> Displaying two articles side-by-side:
>> 
>>    .article1 { overflow-style:paged-x; }
>>    .article2 { flow-into:second-article; }
>>    @master-template {
>>      template-slots: content, right;
>>      <slot-syntax>(content) {
>>        width: 40%;
>>        padding: 5%
>>        float:left;
>>      }
>>      <slot-syntax>(right) {
>>        flow-from: second-article;
>>        width: 40%;
>>        padding: 5%
>>        float:right;
>>      }
>>    }
> 
> Hmm. In the above example you flow the second article into the 'right'
> slot, while the 'content' slot presumable is empty? If so, why are
> they both declared in 'template-slots'? I guess I don't understand what it
> does.

The content slot gets all of the content from .article1

Perhaps I wasn't clear enough in the first series of examples, but 'content'
is a special term in a master template that is the explicit expression of
the implicit slot that takes all of the paginated element's content.

Thanks,

Alan

Received on Thursday, 23 February 2012 16:16:42 UTC