Attachment

List pages with attachments (tests if "attachment" or "attachments")


define common variables
(:group:-Archive,-Archives,-Backup,-Calendar,-banners,-cjc,-Cookbook-V1:)
(:order:name,group:)
(:count:30:)
test 'if attachments' in pagelist
>>comment<<
[[#attachmentspagelist]]
(:template each:)
%green%[- [[{=$FullName}]] -]
[[#attachmentspagelistend]]
>>smaller<<

(:pagelist if=attachments fmt=#attachmentspagelist list=normal count={$:count} order={$:order} group={$:group}:)

(:template each:) {=$FullName}


test 'if attachments' in pagelist template defaults
>>comment<<
[[#attachmentspagelisttemplate]]
(:template defaults if=attachments:)
(:template each:)
%green%[- [[{=$FullName}]] -]
[[#attachmentspagelisttemplateend]]
>>smaller<<

(:pagelist fmt=#attachmentspagelisttemplate list=normal count={$:count} order={$:order} group={$:group}:)

(:template defaults if=attachments:) (:template each:) {=$FullName}


test 'if attachments' in template body
>>comment<<
[[#attachments]]
(:template each:)
(:if attachments:)
%green%[- [[{=$FullName}]] -]
(:else:)
%red%''[- [[{=$FullName}]] -]''
(:ifend:)
[[#attachmentsend]]
>>smaller<<

(:pagelist fmt=#attachments list=normal count={$:count} order={$:order} group={$:group}:)

(:template each:) {=$FullName}


test 'if attachment'
>>comment<<
[[#attachment]]
(:template each:)
(:if attachment:)
%green%[- [[{=$FullName}]] -]
(:else:)
%red%''[- [[{=$FullName}]] -]''
(:ifend:)
[[#attachmentend]]
>>smaller<<

(:pagelist fmt=#attachment list=normal count={$:count} order={$:order} group=-{$:group}:)

(:template each:) {=$FullName}

Note that if attachment is not defined and will always appear as true ('attachment' is not 'false' or other existing condition). You will have the same with if simon or if petko :-) --Petko


test 'if ! attachments'
>>comment<<
[[#notattachments]]
(:template each:)
(:if ! attachments:)
%red%''[- [[{=$FullName}]] -]''
(:else:)
%green%[- [[{=$FullName}]] -]
(:ifend:)
[[#notattachmentsend]]
>>smaller<<

(:pagelist fmt=#notattachments list=normal count={$:count} order={$:order} group=-{$:group}:)

(:template each:) {=$FullName}

Peak memory: 9,352,120 bytes