Menu

Template questions

Help
John Voth
2002-09-05
2002-09-06
  • John Voth

    John Voth - 2002-09-05

    As I construct a template for my site, I would like to know if Magellan has the ability to treat a certain area as a sub-template?

    Here is my context.

    If we look at the <b>en-standard.txt</b> template, we notice that the left hand column is the main navigational structure. Sure, there's one along the top also but let's forget that it's there for the moment.

    I would like to make that left hand column into a block of code that I can edit independantly of the template or the page.

    If I were handcoding this design, it might look something like this:

    <table>
      <tr>
        <td>  </td>
        <td> <? include_once("header.php"); ?> </td>
        <td>  </td>
      </tr>
      <tr>
        <td> <? include_once("main_nav.php"); ?> </td>
        <td> <? include_once("page_body.php"); ?> </td>
        <td>  </td>
      </tr>
      <tr>
        <td>  </td>
        <td> <? include_once("footer.php"); ?> </td>
        <td>  </td>
      </tr>
    </table>

    I would like to know if Magellan can treat the file "main_nav.php" (or whatever it's called) like a sub-template?

    If not then I have to compose a template similar to my example above and then hand edit the main_nav.php file outside of Magellan. Ugh!

    What do you all think?

    John

     
    • Alex Pagnoni

      Alex Pagnoni - 2002-09-06

      Hi John, you may create header.php, main_nav.php etc. as Magellan pages with their own templates, and then use the block of code you wrote in your standard template.

      You can write PHP code in templates as if they were normal .php pages, since once Magellan pages are rendered with their own templates they are reinterpreted by PHP.

      Hope this helps :-) Anyway there's also another advanced module that extends Magellan templates functions, it is a preprocessor based on the htp project (you can read htp specs here to have an idea: http://maths.newcastle.edu.au/~rking/htp/\).

      I use it for Solarix and Ampoliros templates, since there are many templates and if I want to change a common element I would have to change it in all the templates. With this module, you modify only a file that is applied to all the templates.

      I haven't published it yet because it has the old interface style, but if you want, I can release it.

      Alex

       

Log in to post a comment.

MongoDB Logo MongoDB