Tags:
create new tag
, view all tags

Feature Proposals » INCLUDE with new attachment parameter to include an attachment

Summary

Current State: Developer: Reason: Date: Concerns By: Bug Tracking: Proposed For:
MergedToCore HideyoImazu AcceptedBy7DayFeedbackPeriod 2014-11-21   TWikibug:Item7599 KampalaRelease

Edit Form

TopicSummary:
CurrentState:
CommittedDeveloper:
ReasonForDecision:
DateOfCommitment:   Format: YYYY-MM-DD
ConcernRaisedBy:
BugTracking:
OutstandingIssues:
RelatedTopics:
InterestedParties:
ProposedFor:
TWikiContributors:
 

Motivation

You can include an attachment with %INCLUDE{%ATTACHURL%/filename.ext}%, which causes INCLUDE to retrieve the specified attachment directly without issuing an HTTP request to itself now that TWikibug:Item7592 is implemented. Still, this is roundabout -- composing an attachment URL and then having INCLUDE parse it. Plus, you need to put variables such as %ATTACHURL%, %PUBURL%, and %WEB% as shown in the examples below, which is no big deal but it's better to be able to do the same things without using those variables.

IncludeAttachment was proposed and partially implemented in 2004 but that feature seemed to have abandoned later. This proposal is to revive that feature.

Description and Documentation

  • Introduce attachment="filename.ext" parameter to INCLUDE. Variables in the attachment is evaluated in the context of the web and topic it's attached
  • %INCLUDE{%PUBURL%/WebName/TopicName/filename.ext}% keeps working as before. It's close to %INCLUDE{"WebName.TopicName" attachment="filename.ext"}% but not identical -- topic context change doesn't happen. This is to make it consistent with an inclusion from outside TWiki.

Examples

Conventional way Proposed way Variable
expansion
context
of the proposed way
Comment
%INCLUDE{%ATTACHURL%/filename.ext}% %INCLUDE{attachment="filename.ext"}% current topic an attachment of the current topic
%INCLUDE{%PUBURL%/%WEB%/TopicName/filename.ext}% %INCLUDE{"TopicName" attachment="filename.ext"}% TopicName an attachment of a different topic of the current web
%INCLUDE{%PUBURL%/WebName/TopicName/filename.ext}% %INCLUDE{"WebName.TopicName" attachment="filename.ext"}% WebName.TopicName an attachment of a different web

Impact

Implementation

-- Contributors: Hideyo Imazu - 2014-11-21

Discussion

This is a sensible enhancement.

-- Peter Thoeny - 2014-11-30

Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r10 - 2015-06-07 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.