Hi, i''m searching to insert a relocatable image into a my plugin, but i don''t want to reimplement what was already done... i saw that in the gallery plugin there''s something like: <img src=\"{relocatable: #{imgname}}\"/> but i wasn''t able to reproduce this behavior.... How can i make this work? thanks, bye. -- -gaspa- ----------------------------------------------- --------- Powered by Debian GNU/Linux --------- -Il lunedi''dell''arrampicatore: www.lunedi.org -
Hi Andrea, On 29.06.2007, at 00:43, Andrea Gasparini wrote:> i''m searching to insert a relocatable image into a my plugin, but i > don''t > want to reimplement what was already done... > > i saw that in the gallery plugin there''s something like: > <img src=\"{relocatable: #{imgname}}\"/> > but i wasn''t able to reproduce this behavior....Yes, a helper method of the GalleryInfo class provides an easy way to insert an image tag in a gallery template. The relocatable tag can be used here because the template is processed afterwards. Hmm... what kind of webgen plugin did you write? If you wrote a tag plugin, you could just use the relocatable tag in the output of your plugin, for example: def process_tag( tag, chain ) @process_output = true content = ''<img src="{relocatable: /images/my.png}" />'' # Other things done with content content end If you didn''t write a tag plugin, I need a little bit more information about your plugin. All the relocatable tag does is to get the relative path to the argument. This is done like this: node = ref_node.resolve_node(path) # resolves the node for the given path current_node.route_to(node) # returns a relative URL to the given node from current_node Regards, Thomas
Hi Thomas, Thomas Leitner spiffera, alle Friday 29 June 2007 circa:> Hmm... what kind of webgen plugin did you write? If you wrote a tag > plugin, you could just use the relocatable tag in the output of your > plugin, for example:no, it''s just another menu plugin ( i could call it: YAMP ) ;-)> All the relocatable tag does is to get the relative path to the > argument. This is done like this:i see, and i''ll try this way, and afterwards i''ll make you know if i need more effort :) thanks, bye! -- -gaspa- ----------------------------------------------- --------- Powered by Debian GNU/Linux --------- ------ HomePage: iogaspa.altervista.org ------- -Il lunedi''dell''arrampicatore: www.lunedi.org -
Hi, Thomas and all...> i see, and i''ll try this way, and afterwards i''ll make you know if i > need more effort :)I''ve done it! i finally got online my homesite, i don''t know if it could be useful, but i''ve: - used news plugin in webgen 0.4.2 ... it work out of the box, great. (there''s a problem in maxentries option, but i didn''t investigate ) - changed the vertical menu for using a better (for my uses, of course) set of tags. (for examples, the images instead of using background of <a>, are more flexibles... ) ( at the question: why do you use this version? I''ll reply saying: because it''s the newest version packaged for debian... ) Thanks for all the helps. :D Bye! -- -gaspa- ----------------------------------------------- --------- Powered by Debian GNU/Linux --------- ------ HomePage: iogaspa.altervista.org ------- -Il lunedi''dell''arrampicatore: www.lunedi.org -