You are not logged in Log in Join
You are here: Home » Members » dedalu » Criar links reversos de forma eficaz (barra de navega��o)

Log in
Name

Password

 

Criar links reversos de forma eficaz (barra de navega��o)

It's based on other how-to (please, tell-me the author).

Coloque o dtml navbar e o script obterParents na raiz e chame dtml-var navbar onde voc� desejar (inclusive dentro dos ZDTopics da vida).

Nota: '-' � igual a espa�o.

1) dtml-method navbar
=====================
<dtml-in "z_obterParents(3)" skip_unauthorized>
-<dtml-with sequence-item>
--<a href="&dtml-absolute_url;">
---<dtml-var title_or_id>
--</a>
-</dtml-with>
-<dtml-unless sequence-end>&nbsp;&gt;&nbsp;
-</dtml-unless>
</dtml-in>

2) python script obterParents(ultimo)
=====================================
lst = []

request = container.REQUEST

for path in request.PARENTS:
-duplicata = 0
-for x in lst:
--if x.absolute_url() == path.absolute_url():
---duplicata = 1

-if not duplicata:
--lst.append(path)

result = lst[:ultimo]
result.reverse()

return result

Pronto. Voc� pode otimizar este c�digo.

T+v