Fred Hirsch wrote:
> 
> This sounds like a similar problem that I was having in doing a dynamic
> nav-link style. I heard lots of advice in using argv to extract from the
> $midgard->uri. I never did figure out why I couldn't get argv to work,
> from all I can tell, it only holds the name of the last file in the
> chain in the URI, and not its extension. So, I reverted to an old Perl
> fallback, regex:

the argv array holds all path elements that come *after* the URI of the
active (and only active) page. So if /company/ is active,
/company/department/activities/outdoors/survival.html will result in
$argv = [ "department", "activities", "outdoors", "survival" ]
The trailing '.html' is stripped since we've mostyly used it to
pass IDs and the .html was just for pretty URLs and for some braindead
browsers that used the extensions instead of the Content-type header
to determine how to display the page data. IE has fixed this since
4.something I think.

> <?
> $topic1 = $midgard->uri;
> if (preg_match("/company/", $topic1)) {
> ?>
> <img src="/images/bullet_sm.gif" WIDTH="30" HEIGHT="9"><a
> href="/company/17.htm" class="menuleft">Member Directory</a><br>
> <img src="/images/bullet_sm.gif" WIDTH="30" HEIGHT="9"><a
> href="/company/news/" class="menuleft">News Releases</a><br>
> <img src="/images/bullet_sm.gif" WIDTH="30" HEIGHT="9"><a
> href="/company/legal/" class="menuleft">Legal
> Documents</a><br>
> <img src="/images/bullet_sm.gif" WIDTH="30" HEIGHT="9"><a
> href="/company/contact/" class="menuleft">Inquiry/Orders</a><br>
> <?}?>

If you wanted to match 'company' in argv that would mean you'd need to
set the
root page to active (not a very common practice).

> Ken Pooley wrote:
> > I was thinking of some thing a little more simple...at least from the
> > outside and elegant, at some point I will figure it out and be able to
> > show/explain it but I need to come up with a solution ...but what you are
> > saying will work...in fact once you said that I noticed that the main
> > midgard site uses this strategy or something close to it...say on the site
> > links to the right where they go to "http.../topic/73.html"... the demo site
> > doesn't do that,it has "hardwired" subpages, how does it work at
> > www.midgard-project.org ....

The same. You can sefaly assume that anything (besides the images) that
has a
'human-readable' path is using a page record.

> > the problem I still seem to have is that I don't
> > see the mechanism by which the topic ID gets passed to the next page,

These pages are all active, see explanation above.

> > actually I haven't quite figured out exactly where the article ID gets
> > passed either and therein is probably the problem...is this what the
> > code-init does?

Code-init can certainly act on this data, but the difference lies in
active
vs. static pages.

emile

--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to