Log in | Register | Lost password

Bottom
Possibilities for expanding -list.html templates?
  • Posted: 12.01.2004, 08:15
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    I am interested in a pagesetter feature and am up for contributing some code if OK.

    Like others, I want to sort by lists but I don't want to stop there- I want to be able to group and format the -list.html displays around a list value.

    Currently, lists use the following template sequence when using
    index.php?module=pagesetter&tid=T

    -list-header.html
    -list.html
    ...
    -list.html
    -list-footer.html


    What I would like to do is use a link like
    index.php?module=pagesetter&tid=T&group=ID where the ID specifies my list of choice (ID could either be the Name or a field ID number).

    Anyway the following template sequence usage would ensue to create the output:

    -list-header.html

    -list-type-header.html
    -list.html
    ...
    -list.html
    -list-type-footer.html

    ...

    -list-type-header.html
    -list.html
    ...
    -list.html
    -list-type-footer.html

    -list-footer.html

    Note the addition of -list-type-header.html and -list-type-footer.html.

    As an example, say you wanted to create a series of tables with the list being the table header, your new templates would look something like this:

    -list-type-header.html
    ----------------------



    Where $Type.title is your list names.


    -list-type-footer.html
    ----------------------



    This could allow for output like:


    Fruits
    ------
    Apple
    Orange


    Meats
    -----
    Chicken
    Beef



    Here, you would have a list type that has "Fruits and Meats".


    Obviously with nested lists you could add more nesting of formats- this is beyond my needs but it could be supported by defining a template naming standard like -header1.html, -header2.html, -header3.html ...


    -Bryan
  • Posted: 12.01.2004, 08:34
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Very interesting. Could you please add it as a feature request on SF.
  • Posted: 12.01.2004, 11:56
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    This "group"-feature would be something equal to topics? The possibility to create and sort publications by topics are highly needed (also filtering by character, date ...)
  • Posted: 12.01.2004, 16:04
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    J?rn,

    with only _one_ template for lists this issue wouldn't arise... We have discussed this previously, and I still think that it would be smarter to solve it this way. (you could still "include" the old templates if you want backward compatibility).

    In this case, all items will be passed to the template. The template could call some sorting function on the array and then display the results (this is the way I did in EZComments -- you can decide if you want comments flat & sorted by date or nested, just by calling the appropriate sort function).

    J?rg
  • Posted: 12.01.2004, 17:26
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Yes, J?rg, I think you are right. At least in the conversion to a single template.

    For performance reasons I disagree in the sorting and grouping - this should be done by the database.
  • Posted: 12.01.2004, 18:31
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0

    Quote

    Could you please add it as a feature request on SF.

    I will- since a discuss has been started I will wait till after it is complete.


    Quote

    In this case, all items will be passed to the template. The template could call some sorting function on the array and then display the results (this is the way I did in EZComments -- you can decide if you want comments flat & sorted by date or nested, just by calling the appropriate sort function).

    This is correct and seems to be a more flexible solution. Is there a way now to get all the fields for all the records in the array in one pagesetter template now? I wasn't able to see how (this would solve my needs).

    J?rg, I'm not sure if you meant to this extreme but with this approach you could really just have one template for ALL publication types replacing list.html, list-header.html, list-footer.html, full.html, print.html, xml.html and mail.html. All you would have do to is pass the publication type to the template-- this would allow for less duplicate logic between the various xmllist, printlist, and other templates. In fact, it seems this could also allow for open-ended &func= types so the user can define whatever type of publications they want (just define a new &func= type link and add support for it in the template). Pagesetter could still provide a single out-of-the-box template that does the current functions.

    OK, just to rattle on some more, I see two distinct publication views, those with a tid and those with a tid and pid. In the first case you should get all the data for all pid's, in the second you should obviously just get the data for one pid. So, to backtrack on what I previously said, maybe you could have two templates for these two different situations as I don't think the two templates would share much logic or display mark-up.

    Just $0.02 from a non-expert.


    -Bryan
  • Posted: 12.01.2004, 19:13
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    You could to some degree do what you are suggesting. But there are some important differences in the templates:

    1) The standard functions prints a list/single item inside the PN-theme stuff

    2) The print template is printed without the PN-theme stuff

    3) The XML template prints no PN-theme stuff AND outputs Content-Type: text/xml (which is rather important)

    4) The mail template is expected to included inside a lot of other stuff in addition to the PN-frames.

    So all in all there's a reason for the different template kinds.
  • Posted: 13.01.2004, 00:52
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Thanks for the feedback- I understand, it seems to make sense that pagesetter has to do some things fundamentally different based on some of the different func types before evoking the templates.


    Quote

    You could to some degree do what you are suggesting.

    It is possible to get all the data in all the pid's for one tid in a pagesetter template? I haven't see how-- this would resolve my initial issue.


    Quote

    For performance reasons I disagree in the sorting and grouping - this should be done by the database.

    My $0.02- it would be great if pagesetter offered a way for linking with different sorting methods so that a template could offer a link to re-sort itself. For example, say you have a list of peoples names, it would be nice to be able to allow a sorting by both first name and last name. Or is this already possible?

    Still, no reason that a template couldn't do additional sorting- the more rope the better. :D


  • Posted: 13.01.2004, 07:54
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    Pagesetter will come with a single template setup where all items are passed in one array.

    Sorting is a SF request already.
  • Posted: 13.01.2004, 21:42
     
    Converted
    rank:
    12
    registered:
     March 2009
    Status:
    offline
    last visit:
    Posts:
    0
    OK, great- thanks. That will solve my needs as specified here. I could still add this to the SF feature request if you think it warrants- I don't think it would be a necessary feature however. Let me know if you want me to do so.

    Thanks again.

Template courtesy of Designs By Darren.