Well I never used 'base' before; that was your idea :)
Anyhow 'base' should be in the head section, I don't think it would be
such a good idea to use it.

To make a shortcut in your page how about generating an URL string and
then just prepending it to the image tags?  For example:

Create the string:
  {{u=URL('static',args=('plugin_layouts','layouts','Optimism'))}}

Use it wherever you wish in the view:
  <img src="{{=u}}/image.jpg" />

Just an idea, but it might simplify things a little if there are many
links.


On Feb 15, 4:33 pm, stargate <[email protected]> wrote:
> This line generates a error
>
> <base href="{{(URL(request.application,'static','plugin_layouts/
> layouts/Optimism/')}}" />
>
> Not sure why
>
> On Feb 15, 9:40 am, villas <[email protected]> wrote:
>
> > 'base' is for when all links on that page are to the same place.  You
> > have to decide that.
>
> > However,  I don't think 'response.files' is right for that. Maybe this
> > would be better...
> > <base href="{{(URL(request.application,'static','plugin_layouts/
> > layouts/Optimism/')}}" />
>
> > -D
>
> > On Feb 15, 1:28 pm, stargate <[email protected]> wrote:
>
> > > Wouldn't it also better to use
>
> > > <base
> > > href="{{response.files.append(URL(request.application,'static','plugin_layouts/
> > > layouts/Optimism/'))}} " />
>
> > > This would cut time for inserting the code in every image tag on the
> > > page.  Please correct me if i am wrong.
>
> > > On Feb 15, 1:04 am, villas <[email protected]> wrote:
>
> > > > > Why would you have another folder called layouts.
>
> > > > I only copied what was in the other post to demonstrate a different
> > > > (more recent) syntax.
>
> > > > If you look in the views/layout.html file you will see how the
> > > > other .js files are included,
> > > > e.g. {{response.files.append(URL('static','js/superfish.js'))}}
>
> > > > It is best if you examine your own paths,  then you will see where
> > > > your files are located and be able to learn to link to them
> > > > accordingly.  Do you have this file? :  static/plugin_layout/Optimism/
> > > > js/cufon-yui.js
> > > > If so, then what you have should be OK.
>
> > > > I think this would be more recommended:
> > > > {{response.files.append(URL('static','plugin_layout/Optimism/js/cufon-
> > > > yui.js'))}}
>
> > > > If you have Firefox browser,  experiment with the Firebug plug-in.
> > > > You can see exactly what is being found and included in your pages. It
> > > > is a good, worthwhile tool.
>
> > > > -D
>
> > > > On Feb 15, 3:21 am, stargate <[email protected]> wrote:
>
> > > > > I am trying to figure out a proper structure.  Right now i have it
> > > > > like this.
>
> > > > > ../<appname>/static/plugin_layouts/Optimism/images/img17.jpg
>
> > > > > Why would you have another folder called layouts.
>
> > > > > Also i am including my scripts like this
>
> > > > >  <script src="{{=URL('static','plugin_layout/Optimism/js/cufon-
> > > > > yui.js')}}"></script>
>
> > > > > Is that correct
>
> > > > > On Feb 14, 8:38 pm, villas <[email protected]> wrote:
>
> > > > > > > <img src="{{=URL(r=request, c='static', f='plugin_layouts/layouts/
> > > > > > > Optimism/images/img17.jpg')}}" alt="" width="90" height="90" />
>
> > > > > > You could also try this format (available in more recent versions of
> > > > > > web2py):
>
> > > > > > {{=IMG(_src=URL('static','plugin_layouts',args=('layouts','optimism','images','img17.jpg')),_alt='pic',_width='90',_height='90')}}
>
>

Reply via email to