[Zope-CMF] Problems with calling portal_actions
Slade Mrs A
A.Slade@rmcs.cranfield.ac.uk
Wed, 16 Apr 2003 13:38:07 +0100
I'm totally bamboozled with this silly little python interpretation error
and am hoping someone can help me?
I have some actions set up in portal_actions that I am using for a
navigation system. I'm trying to do a tal:repeat over these portal_actions,
which are defined as category 'portal_subcontents1', 'portal_subcontents2'
... 'portal_subcontents7. Therefore, I'm trying to loop over them and each
time append repeat/tab/index(+1) to the name 'portal_subcontents'.
So, you can see in line 2, I set a variable called 'current' which is set to
repeat/tab/index.
In line 3, I append (current+1) to the string 'portal_subcontents'.
In line 4, I try to set portal_contents to 'portal_subcontents1' on the
first iteration, 'portal_subcontents2' on the second iteration, and so on.
However, I get nothing!! It doesn't find anything called
actions/portal_subcontents1. However, if I replace 'actions/subnav' with
'actions/portal_subcontents1', it works fine. So, I think my syntax must be
wrong as it's not interpretting what I want it to.
1 <div class="subtabs"
2 tal:define="current repeat/tab/index;
3 subnav python:'portal_subcontents' +
str(current+1);
4 portal_contents actions/subnav|nothing;
5 global selected_content_tabs
python:here.selectedTabs(template.getId(), here);
6 selected_content_tab
selected_content_tabs/portal;" >
7
8 portal_Contents:<span
tal:content="portal_contents">content</span>
9 <metal:block tal:condition="portal_contents"
10 tal:repeat="subtab portal_contents">
11 <span tal:replace="subtab/name">dummy</span></span>
12 <br/>
13 </metal:block>
15 </div>
I hope this makes sense!
Thanks in advance for your help.
Regards,
April