[web2py] Re: Web2py: Using images in HTML data
That's what I thought too And if it's all coming from static, why don't you just keep in db the path from inside the static folder ( in your case "images/image.gif") and then in your view you build the path On Sunday, 19 April 2015 04:57:00 UTC+2, Niphlod wrote: > > can't you just use some templating and parse the richbox text, turning > /mysitename/static/image.png to /%whatever%/static/image.png ,store that on > db, and upon rendering replacing %whatever% with request.application ? > > On Sunday, April 19, 2015 at 3:18:16 AM UTC+2, Joe Magaro wrote: >> >> 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: 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.
[web2py] Re: Web2py: Using images in HTML data
can't you just use some templating and parse the richbox text, turning /mysitename/static/image.png to /%whatever%/static/image.png ,store that on db, and upon rendering replacing %whatever% with request.application ? On Sunday, April 19, 2015 at 3:18:16 AM UTC+2, Joe Magaro wrote: > > 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: >>> >>> >>> >>> 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.
[web2py] Re: Web2py: Using images in HTML data
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: >> >> >> >> 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.
[web2py] Re: Web2py: Using images in HTML data
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: > > > > 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.
[web2py] Re: Web2py: Using images in HTML data
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: 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.