Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to display dynamic menus (main menu) as images. The images are stored in MySQL database. I have created menu_top.pt (page template) and it looks like this:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
  <metal:main fill-slot="main">
         <div style="position:absolute; visibility: visible; width: 540px; height: 20px; z-index: 2; left: 200px; top: 10px"> 
            <table  tal:define = "res python:view.top_menu()" style=" width:100%; float:left;">
            <tr tal:repeat = "rep python:res" style=" width:235px; float:left;padding-left:20px">
                <td tal:define="image_id python:rep[0];path python:rep[1]">

                    <!--input type="text" name="image_id" value="" tal:attributes="value python:image_id" size="2"-->
                    <img src="" tal:attributes="src python:path">


tal:define = "res python:view.top_menu()" --> the top_menu is getting the images from .py file. Then in Zope I have altered the main_template. So I put my header named as menu_top under portal_skins -> custom -> menu_top.pt and I have included menu_top in main_template. But I'm getting an error as follows:

AttributeError("'Plone' object has no attribute 'top_menu'",)

top_menu is the method which is in .py file.

share|improve this question
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.