Changeset 846

Show
Ignore:
Timestamp:
04/18/07 10:01:03
Author:
piv
Message:

merged with pmedium/branches/ci: portlet render url of link as remote_url

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qSiloGroup/trunk/skins/qSiloGroup/getSiloNavigationDictionary.py

    r740 r846  
    99# 
    1010 
     11from Products.CMFCore.utils import getToolByName 
     12 
    1113if context.portal_type in ['Folder', 'Large Plone Folder', 'CMFFolder']: CONTEXT = context 
    1214else: CONTEXT = context.aq_parent 
     
    1719    return {} 
    1820 
     21links = getToolByName(context, 'portal_catalog').searchResults(path="/".join(CONTEXT.getPhysicalPath()), portal_type="Link") 
     22links_dict = {} 
     23for l in links: 
     24    links_dict[l.getId] = l.getRemoteUrl 
     25 
    1926prop_dict = {} 
    2027for i in items: 
    2128    s = map(str, i.split('|')) 
     29    id = s[0] 
     30    path = id 
     31    link = False 
    2232    try: 
    2333        if len(s) == 2: 
    2434            title = s[1] 
    25             path = s[0] 
    2635        else: 
    27             if s[1]: s[1] = '/'+s[1] 
    2836            title = s[2] 
    29             path = s[0] + s[1] 
    30         prop_dict[s[0]] = {'id': s[0], 'path':path, 'title':title} 
     37            path += s[1] and ('/'+s[1]) or s[1] 
     38        if id in links_dict.keys(): 
     39            link = True 
     40            path = links_dict[id] 
     41        prop_dict[id] = {'id': id, 'path':path, 'title':title, 'link':link} 
    3142    except: continue 
    3243 
  • qSiloGroup/trunk/skins/qSiloGroup/portlet_navigation.pt

    r740 r846  
    1919              <li class="navTreeItem visualNoMarker" 
    2020                  tal:define="item_id item/id; 
    21                               item_title item/title
     21                              item_title item/title;
    2222                  tal:condition="python:item_id and item_id != default_page and item_title"> 
    2323                <div> 
    2424                  <a tal:condition="item_title" 
    25                      tal:attributes="href string:${silo/absolute_url}/${item/path};
     25                     tal:attributes="href python:test(item['link'], item['path'], silo.absolute_url()+'/'+item['path'])
    2626                     tal:content="item_title|nothing"> 
    2727                     Item Title</a>