On Fri, 2005-12-16 at 14:22 +1100, Kim Ryan wrote:
> Hi,
> 
> I have just installed Maypole and converted the BeerDB example to suit 
> my data. Everything is displaying OK, but I want to simplify the
>  templates, specifically to remove the edit and delete buttons from the
>  listing of table rows.
> 
> I copied the factory templates up into the application template area, 
> and manged to modify them to remove the add_new section in the list. I
>  am struggling to remove the edit and delete buttons, though I removed
>  all reference to them in view and list templates but they still
>  appear.

If you look closely at the list template, you'll see that the list is
produced using a macro called display_line(). That can be found in the
macros template and then you'll easily see the calls to the button()
macro that create the edit and delete buttons.

I find that grep or grep -r is a very useful tool for finding where
things happen in templates (and code :)  For example 'grep delete *'
shows you the occurrence I just described plus the one that adds the
button in the view template.

> I have read the training wheels guide, but am stuck on a few points.
> 
> Is it better to build templates from scratch, or modify the factory one?

Opinions differ! Do whichever you find easiest.

> Are there any example of a simple display only template?

The view template seems pretty simple. It's worth reading the view
chapter of the manual:

http://search.cpan.org/~teejay/Maypole-2.10/lib/Maypole/Manual/View.pod

That seems to have more information about templates than the template
chapter :)  And of course there's a whole template toolkit site with
more information:

http://www.template-toolkit.org/

HTH, Dave



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to