You could create a single function (maybe call it something like 'content')
and pass an argument in the URL to determine the view to display:
def content():
response.view = 'default/%s.%s' % (request.args(0), request.extension)
if request.args else 'default/index.html'
return dict()
URLs would look like /app/default/content/intro1-page1, etc. If you'd
prefer something like /intro1/page1, you could use request.args(0) and
request.args(1).
Anthony
On Friday, October 28, 2011 9:02:50 PM UTC-4, Spring wrote:
>
> Dear All,
>
> I'm developing a website for introduction of something. In this case
> there is quite a lot of static contents (img+text) spreading over
> several pages, like:
>
> Home
> |-----Introduction 1
> | |-----page 1
> | |-----page 2
> | |-----....
> |-----Introduction 2
> | |-----...
> ...
>
> I would like to know what is the best practice to show these static
> pages? Based on my understanding of web2py using MVC, the solution I
> come up with is to create a function for each "click" or page. But the
> will end up having many functions doing almost nothing but only to
> trigger the view and present these static pages. So I would like to
> know if there is better practice to handle this.
>
> Any suggestion is welcome.
>
> Spring