Hello Jamie,

...and welcome to the community!

Jamie Cline wrote:
Hi,

I have been dropped into the deep end of having to work with a Midgard
system, with setting up a website.

I do not have admin access to either the machine or the ability to log
into SG0 (hopefully the right terminology).

That's ok as long as you have administrator rights to the sitegroup you're working with (as you seem to have according to your e-mail).

I believe the system that we are using is Aegir 1.0.1 running on Midgard
1.4.4 (found this on the login page for Aegir)

I have set up a basic site, and I am impressed at how easy coming to
grips with style etc has been, but there are a couple of things that I
would like to achieve but I don't know really where to start (also not
helped by the fact that I am trying to learn PHP at the same time).

This is the right place to ask. :)

I set up the site, following one of the tutorials that I found on the
net, and that is all working, and I am using things like NemeinNavBar
etc for the menu system which is ok, but we are using the index articles
system, which is great for helping to create the navigation system, but
is there anyway of getting the content of the index article to be
created dynamically based on the other articles within that category?
(showing Title & Abstract information).

I assume you're running the Simple Dynamic site or you have the similar base installed already.

If you look at the code in the root page (in Websites),
you should see something like:

<?php

if ($article) {

 //jadajada...

}...

?>

If you want each and every index page to function
similarily, then you can simply write your code inside
that if (article) clause. I.e.

<?php

if ($article) {

  if ($article->name == "index") {

    //Do your index stuff here...

  } else {

    // Do the other stuff here...

  }

}

?>

On the other hand, if you need each index pages
(or some of them) to work differently from each other,
then you would do well to write the PHP code into
article's abstract field (or topic's code) and
modify your root page like this:

<?php

if ($article) {

  if ($article->name == "index") {

?>

    <h1>&(article.title);</h1>
    &(article.content:h);
    &(article.abstract:p);
    &(topic.code:p);

<?php

  } else {

    // Do the other stuff here...

  }

}

?>

Notice the Midgard specific markup "&(article.abstract:p);" -
this means that Midgard will parse article's abstract as
PHP code. (Look for Midgard Formatting engine in the documentation
for more info.)


If so, can someone help me with some input on how to put that in place
(an easy step by step guide would really be helpful)

If I'm being too complicated or not-so-clear on something, just ask again. :)

The other thing that I would like to achieve, if possible, is to create
a navigation tree that appears on each article within a category, that
only shows the links to each of those articles etc sort of like that
menu system on the right hand side of the www.midgard-project.org site.
I assume that you are using MidCom but I don't have access to that (that
I know off... is there anyway to check).

Try this one for the starters:

<?php

// Create a list object
if ($alist = mgd_list_topic_articles($topic->id)) {
// Use fetch() to traverse through the list object
while ($alist->fetch()) {
// We don't want to display index article again, do we???
if ($alist->name != "index") {
echo "<p><a href=\"./&(alist.name:u);.html\">&(alist.title);</a></p>\n";
}
}
}


?>

Too bad you can't get your hands on MidCOM - it really rocks.

Thanks in advance for any assistance and/or advice.

Not a problem, we're more than happy to help you get started.

Cheers!

  //Henri

Regards
Jamie


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to