Zim

Export to HTML Template page.links attribute has no target

Bug #1653243 reported by santiago
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zim
Expired
Undecided
Unassigned

Bug Description

Hello,

I'm trying to use the page.links attribute to iterate over the current page links with the following code:

<!--[% FOR page IN pages %]-->

...........

<div class="menu">
[% FOR link IN page.links %]
<a href='[% uri(link) %]'>[% link.name %]</a>
[% END %]
</div>

...........

[% END %]

And the export shows the following error message:

zim 0.65
Platform: nt
Locale: en_US cp1252
FS encoding: mbcs
Python: (2, 7, 11, 'final', 0)
Gtk: (2, 24, 10)
Pygtk: (2, 24, 0)
Zim revision is:
  branch: 065
  revision: 805 <email address hidden>
  date: 2015-11-01 15:42:45 +0100

======= Traceback =======
  File "zim\gui\widgets.pyo", line 3106, in do_response
  File "zim\gui\exportdialog.pyo", line 62, in do_response_ok
  File "zim\export\exporters\files.pyo", line 83, in export_iter
  File "zim\export\exporters\files.pyo", line 129, in export_page
  File "zim\templates\__init__.pyo", line 174, in process
  File "zim\signals.pyo", line 376, in emit
  File "zim\signals.pyo", line 224, in call_default
  File "zim\templates\__init__.pyo", line 178, in do_process
  File "zim\templates\processor.pyo", line 81, in process
  File "zim\templates\processor.pyo", line 130, in __call__
  File "zim\templates\processor.pyo", line 170, in _loop
  File "zim\templates\processor.pyo", line 130, in __call__
  File "zim\templates\processor.pyo", line 155, in _loop
  File "zim\export\template.pyo", line 489, in links
AttributeError: 'Link' object has no attribute 'target'

As noted in the message, I'm using Zim 0.65 in a Windows 10 machine.

I attach an example book and the template to reproduce the error.

Thanks

Revision history for this message
santiago (serware) wrote :
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Gave it a try on 0.67-rc1 and it seems to work correctly

Changed in zim:
status: New → Incomplete
Revision history for this message
santiago (serware) wrote :

I'll give a try too, thanks.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Zim because there has been no activity for 60 days.]

Changed in zim:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.