Closed Bug 272806 Opened 20 years ago Closed 19 years ago

Use templates for page displays

Categories

(addons.mozilla.org Graveyard :: Public Pages, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Bugzilla-alanjstrBugs, Assigned: Bugzilla-alanjstrBugs)

References

Details

Attachments

(5 files, 7 obsolete files)

One problem is that we have things hardcoded as themes and plugins, especially
in terms of directory structure.  This means that for
http://update.mozilla.org/themes/ and /extensions/ to work, we have duplicates
of a lot of code.  We should break these pages down so that code such as
showlist.php  lives in a central folder and is merely included as a building
component for /themes/showlist.php.  

themes/showlist.php would contain
{set variables for themes specific}
[header include]
[body include]
[sidebar include]
[footer include]

All includes would go in a central directory.  We could have
[categories_sidebar_include]
[developers_sidebar_include]

This would basically allow us to make page templates.
Don't reinvent the wheel. Find a nice template engine and use it, but don't
break *anything*. 

Not going to happen anytime soon.
Target Milestone: 1.0 → Future
http://smarty.php.net/
Assignee: nobody → Bugzilla-alanjstrBugs
I'll need http://sourceforge.net/projects/smarty-gettext/  too.
Status: NEW → ASSIGNED
Attached file Sample header template (obsolete) —
This is a template for the header that swaps in the variables and also allows
localization.
Attached file Wrapper php (obsolete) —
This is a wrapper for the header that would call the template.

Also, note that the header template contains all the html headers.  Title and
optional RSS feed link would be passed in, too.

So is this the way to go?
Attached file Template for showlist (obsolete) —
The only thing I'm not sure about is a for loop where you just pass in the end.
Attached file Template for showlist (obsolete) —
Now covers themes and extensions based on $typename
Attachment #169581 - Attachment is obsolete: true
Attached file inc_header.tpl (obsolete) —
Replace tabs with 2 spaces.  Use if block for RSS link.
Attachment #169541 - Attachment is obsolete: true
Attachment #169761 - Attachment mime type: application/octet-stream → text/plain
Attached file inc_header.php (obsolete) —
Attachment #169542 - Attachment is obsolete: true
Attached file showlist.tpl (obsolete) —
Attachment #169590 - Attachment is obsolete: true
Attached file showlist.php
Still not complete, but big steps forward.
Blocks: 245948
Based on feedback from mconnor
Attachment #169761 - Attachment is obsolete: true
Attachment #169763 - Attachment is obsolete: true
Attached patch showlist.tplSplinter Review
mconnor: you get to polish it up.  And do the php.  After that, I'll do the
rest.
Attachment #169772 - Attachment is obsolete: true
Target Milestone: Future → 2.0
Fixed with AMO 2.0
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: