Where does the menu come from in the default site?

4 views
Skip to first unread message

Michael Connors

unread,
Apr 8, 2010, 1:15:23 PM4/8/10
to zotoni...@googlegroups.com
Hi,

In order to get familiar with Zotonic, I have stripped down the default site to just an about page and a home page.

It seems to work ok, however I don't see the menu unless I hardcode it in _menu.tpl and then include it in base, if I do this however, I will not see the pages in the menu in the admin. How does the default site manage to have a menu out of the box that works properly with the admin?

Thanks,

Michael

--
Michael Connors
Leiden 2313 HZ,
The Netherlands

0031611520252

Arjan Scherpenisse

unread,
Apr 8, 2010, 2:39:56 PM4/8/10
to zotoni...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Michael,

Michael Connors wrote:
> Hi,
>
> In order to get familiar with Zotonic, I have stripped down the default
> site to just an about page and a home page.
>
> It seems to work ok, however I don't see the menu unless I hardcode it
> in _menu.tpl and then include it in base, if I do this however, I will
> not see the pages in the menu in the admin. How does the default site
> manage to have a menu out of the box that works properly with the admin?

The templates/_menu.tpl that is in the default site should not been
there and has been added by mistake by Tim... it contributes to the
confusion, sorry about that.

The menu is included from priv/sites/default/templates/base.tpl on line
33, which uses the {% menu %} scomp which is defined in mod_menu.

This scomp is defined in
modules/mod_menu/scomps/scomp_menu_menu.erl

As you can see in this file, it just loads the menu from the zotonic
config table, and hardcodes the HTML that is used. Not a very nice
solution, I agree. A limitation of the menu is also that it is only a
2-level menu, not an entire website tree. (which is a shortcoming that
has been mentioned before on this list).

Hope this explains it a little.

It would be really nice to have a more expandable and flexible menu
solution... I've put it on the issues list:
http://code.google.com/p/zotonic/issues/detail?id=73

If you have anything to add there, please do :)

Arjan

>
> Thanks,
>
> Michael
>
> --
> Michael Connors
> Leiden 2313 HZ,
> The Netherlands
>
> 0031611520252

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAku+IvwACgkQigE4AbflYeosHQCeNyv4BNicTJZilWwWO483Xdaw
80AAmwQEP0fUt33/EfquBl8f8vWUQAz2
=OWBV
-----END PGP SIGNATURE-----

Michael Connors

unread,
Apr 8, 2010, 4:16:18 PM4/8/10
to zotoni...@googlegroups.com
Thanks Arjan, makes more sense to me now.

Would the multiple menu trees be something you would use for localisation?


Reply all
Reply to author
Forward
0 new messages