Tags:
create new tag
, view all tags
There exists in TextFormattingRules:

%ATTACHURL % : The attachment URL of the current topic. Example usage: If you attach a file to a topic you can refer to it as %ATTACHURL %/image.gif to show the URL of the file or the image in your text.

May I propose that we extend this to be able to specify attachments on other pages?

I propose:

%ATTACHURL{Web.Topic}%

If there are no objections by tomorrow I will have our developers implement this and upload the code.

-- MartinCleaver - 01 Nov 2001

The standard way is to specify %PUBURL%/Web/Topic/File.doc, but a new %ATTACHURL{Web.Topic}%/File.doc might be more intuitive?

-- PeterThoeny - 01 Nov 2001

Q: did this change %ATTACHURL{Web.Topic}% get made? (Yeah, yeah, we will go and try it...)

Suggestion: there should be an officially documented way to do this - link to an attachment of another page, i.e. create a shared attachment. (And, the move atttachment code should update links appropriately.)

In trying this out ourselves, Craig Nelson and I came up with %ATTACHURL%/../TopicName/AttachmentName.

Perhaps it should be %ATTACHURL{Web.Topic,AttachmentName}% rather than %ATTACHURL{Web.Topic}%/AttachmentName.

-- AndyGlew - 17 Nov 2003

The official way is documented in FileAttachments. It is %PUBURL%/%WEB%/OtherTopic/file.doc and %PUBURL%/Otherweb/OtherTopic/file.doc

-- PeterThoeny - 22 Nov 2003

I've thought of a place that would make this more useful:

I'd like a directive that means "first picture" attached to a topic. This could be used to, for example, turn photos attached to people's home topics into a mugshot gallery. It would be needed because people will not use consistent names to name their pictures. It would also need to have the ability to hold a standard size thumbnail. (A la ImageGalleryPlugin).

Hence the syntax becomes http://www.twiki.org/p/pub/Codev/ExtensionToAttachUrlDirective

Besides this, it fits the plugin convention of putting parameters in braces and doesn't confuse the dot and forward slash as separators between topic and web.

I guess this ought to be a plugin. Hmm. Maybe it could/should be part of ImageGalleryPlugin - I'll check with Will.

-- MartinCleaver - 05 Mar 2004

This could possible be covered by the TopicObjectModel that RaymondLutz has proposed

-- AndreUlrich - 06 Mar 2004

I'd like to see attachments use something like %ATTACHURL{"Web.Topic", file="foo.doc"}% - this is so that TWiki InternationalisationEnhancements (specifically EncodeURLsWithUTF8) can make international characters work properly for attachments (whether it's the filename, topic name or web name that uses such characters). Most modern browsers now use UTF-8 URLs even when the site character set is non-UTF-8, e.g. ISO-8859-1, KOI8-R (Russian) or EUC-JP (Japanese).

The current TWikiBetaRelease includes a rather tricky bit of code that 'reaches out' beyond the %ATTACHURL% variable, URL-encoding the filename as well. While this works, it is a bit fragile since it depends on recognising the filename using a suitable regex. Also, %PUBURL% does not work at all.

-- RichardDonkin - 07 Mar 2004

Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2006-04-29 - SamHasler
 
  • 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.