Hi,
Suggestion: We should have a sample install where such things as this
one could be shown and where others could walk around in read only mode
and look at the code samples.
There are just too many ways to use midcom + styles that it is usually
impossible to understand most of them w/o good examples.
18:22 < tarjei>2 questions: 1. do you have an example of using taviewer
to create an indexpage with an articlelisting that I can take a look at?
18:22 < tarjei> 2. I got a site where I'd like to have a "latest"
section of all subpages, how should that be done within midcom?
18:23 <@torben> 1.
18:23 <@torben> not really, non public at least
18:23 <@torben> the idea is roughly like this:
18:23 <@torben> * for the articles in question, create a substyle
"teaser" (or whatever you'd like to call it)
18:23 <@torben> *the index article needs its own schema (usually having
some topic intruduction or so)
18:24 <@torben> * in the show article of the index style you do
something like this:
18:24 <@torben> (pseudocode!)
18:24 <@torben> retrieve nap instance;
18:24 <@torben> foreach (leaf in the current topic/node)
18:24 <@torben> skip the index_leaf;
18:27 <@torben> $midcom->dynamic_load('midcom-substyle-teaser' .
$anchor_prefix_of_this_topic . $leaf[MIDCOM_NAV_NAME]);
18:27 <@torben> that's about it
18:27 <@torben> the trick is that oyu have a separate substyle only
showing what you want on the index page, and calling it through
dynamic_load
18:28 < tarjei> why dynamic load here?
18:28 <@torben> because this is independant of the component you're
using
18:28 <@torben> you can use the same strategy everywhere
18:29 <@torben> and you can do it from the style
18:29 <@torben> this is the more important point
18:29 <@torben> your style does notknow how the component stores its
data (not in theory, at least)
18:29 < tarjei> where do I get $anchor_prefix_of_this_topic?
18:29 <@torben> MIDCOM_CONTEXT_ANCHORPREFIX should help here
18:30 < tarjei> ok. thanks.
18:31 <@torben> this d_l solution is mainly there to delegate all
possible things back to the component
18:31 <@torben> now to 2.
18:32 <@torben> define ""latest" section of all subpages" please
18:33 < tarjei> in "normal" midgard I'd do
mgd_list_topic_articles_all($id, 'date')
18:34 < tarjei> where $id = root_topic
18:34 <@torben> ah
18:34 <@torben> you want f.x. the latest 5 changes of the site?
18:36 < tarjei> yep
18:36 <@torben> hm
18:36 <@torben> ok
18:36 <@torben> this is not that easy out of the boxx
18:36 <@torben> and calls for some helper in midcom_helper_nav actually
18:36 <@torben> what you need to do:
18:37 <@torben> recursivly iterate over the whole site, load all topics
and nodes into an array indexed by the revised nap timestamp
18:38 < tarjei> I'd say ouch. Yes
18:38 <@torben> perhaps you could skip the topics, but i'm not sure
there, it would depend on what the user wants i think
18:38 <@torben> it is not that bad, if you use midcom's caching
18:38 <@torben> the list would have to be generated only once per db
change, and would then come out of the cache
18:40 <@torben> i think it is feasible, regarding the performance of the
sitemap, which isn't that bad.
18:41 <@torben> i also think it is a way with a good future, as with the
nap metadata interface the chance for a nap data cache is quite high
18:45 <@torben> tarjei: you've got an idea about what you need?
18:47 < tarjei> yes
18:47 < tarjei> thanks a lot.
Tarjei
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]