Does anyone have a method for this?

On Friday, April 17, 2015 at 9:14:59 AM UTC-4, Joe Magaro wrote:
>
> Thanks Annet: I am aware of web2py URL helpers. I use them inside of my 
> views.
>
> However in this case, they wont work for me as the data is stored in a 
> table and output to a web page, I require another method.
>
> On Friday, April 17, 2015 at 3:01:17 AM UTC-4, Annet wrote:
>>
>> Hi Joe,
>>
>> In the book is an example of how to embed an image using helpers:
>>
>>
>> A(IMG(_src=URL('static','logo.png'), _alt="My Logo"), 
>> _href=URL('default','index'))
>>
>>
>> In one of my apps I upload images to a separate app and within that app 
>> to separate folders, to 
>> embed these images I use:
>>
>> <img src="{{=UPLOADSDOMAIN}}/nodeID{{='%s' 
>> %str(request.args(0))}}/{{=row.image}}" class="img-responsive" />
>>
>> where UPLOADSDOMAIN is defined as a constant in a module and references:
>>
>> '/dbmodel/static/uploads'
>>
>> and nodeID{{='%s' %str(request.args(0))}} references the separate folder 
>> and
>> row.image contains image_name.png
>>
>>
>> Kind regards,
>>
>> Annet
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to