1
MACscr
Advanced Theming?
  • 2005/5/12 3:34

  • MACscr

  • Just popping in

  • Posts: 20

  • Since: 2005/5/10


I know i sound like a broken record, so i apologize with all the "well in PN" statements. I have just used PN for 4 years now, so its more comparison.

1) Can I do different templates for different modules? This would be the template that wraps around the module. I understand templating modules themselves as thats a completely seperate issue.

2) Can blocks be assigned to a template using smarty? Without using smarty can they be assigned to a particular module?

3) Can I assigned a template to a particular block?

4) Can I set permissions using smarty within the template?


Ive gotten pretty good with Xanthia for Postnuke and am hoping to be able to have close to the same amount of control of my layout with xoops. So far that i have seen with the themes available for xoops, they are all rather simple. Of course im going to make my own theme. But i need to find one that i can "hack" to see what all can be done.

Thanks,
MACscr

2
LazyBadger
Re: Advanced Theming?

Preface - I know nothing about PN, I onley read some themes, thus I can say delirium in PN-areas... and I can make errors in XOOPS-related stuff
As I understand, there is one big difference in PN in XOOPS in theming - while PN-theme define completely view of module page, XOOPS uses multitier (2-tiers) method. I.e - common view of all pages defined in theme - page layout design of elements (menues, blocks for content), modules templates for pages and blocks define presentation of datf for module specific objects... but wrapper of data defined in theme...
That's all about theory. let's return to your questions
Quote:
Can I do different templates for different modules?

Because module haven't template, only module's pages have templates (see above), I re-wrote it into "can he have module-specific theme changes". Yes, if with some trick we will get in theme smarty-var, which contain name of active module. Such code-snippet already exist and with it it a task of if-elseif pack inside theme for module's desing segragation
Quote:
Can blocks be assigned to a template using smarty?
Templates can and assined to block using Smarty. You can don't use smarty inside template, but it violates principles separation logic from presentation (for dinamic data you'll have to use PHP, extract and process block-data)
Quote:
Can I assigned a template to a particular block?
Must, and it's aleays done in XOOPS... you can change it, if you want, easy
Quote:
Can I set permissions using smarty within the template?
AFAIK, it's
- impossible
- useless
because permission management on block and module level is separate task outside template-design management

3
MACscr
Re: Advanced Theming?
  • 2005/5/12 5:14

  • MACscr

  • Just popping in

  • Posts: 20

  • Since: 2005/5/10


Well, its sounding like XOOPS theming is pretting weak then. Not having complete control of presentation is no good in my book.

I understand that seperating logic from presentation the point of templates. But I use them more as a way being able to upgrade a module, without losing my changes for presentation and added logic. Here is an example of a template for a users profile.




  

  

<
table border="0" width="100%" cellspacing="0" cellpadding="0">
    <
tr>
        <
td><b>&nbsp;&nbsp;&nbsp;<span class="pn-title">Client Account Information for &nbsp;span>b>
                        
                            
                                &
nbsp;(<a href="admin.php?module=User&op=modifyUser&chng_uid=&authid=">ADMIN EDITa>)
                            
                            
                                
                        
td>
    tr>
    <
tr>
        <
td>
        td>
    tr>
    <
tr>
        <
td>
        <
table border="0" width="100%" cellspacing="5" cellpadding="5">
            <
tr>
                <
td valign="top"><u><b>Contact Infob>u>td>
                <
td valign="top"><u><b>Recent Forum Postsb>u>td>
            tr>
            <
tr>
                <
td valign="top">
                <
table border="0" width="100%" cellspacing="0" cellpadding="0" id="table1">
                    <
tr>
                        <
td>User:&nbsp;td>
                    tr>
                    <
tr>
                        <
td>&nbsp;td>
                    tr>
                    <
tr>
                        <
td>&nbsp;td>
                    tr>
                    <
tr>
                        <
td>&nbsp;td>
                    tr>
                    <
tr>
                        <
td>td>
                    tr>
                    <
tr>
                        <
td>td>
                    tr>
                    <
tr>
                        <
td>
AK

AL

AR

AZ

CA

CO

CT

DC

DE

FL

GA

HI

IA

ID

IL

IN

KS

KY

LA

MA

MD

ME

MI

MN

MO

MS

MT

NC

ND

NE

NH

NJ

NM

NV

NY

OH

OK

OR

PA

RI

SC

SD

TN

TX

UT

VA

VT

WA

WI

WV

WY

AA

AE

AP

AS

FM

GU

MH

MP

PR

PW

VI

N/A
&nbsp;td>
                    tr>
                    <
tr>
                        <
td>&nbsp;td>
                    tr>
                    <
tr>
                        <
td>&nbsp;td>
                    tr>
                    <
tr>
                        <
td>&nbsp;td>
                    tr>
                    <
tr>
                        <
td>&nbsp;td>
                    tr>
                    <
tr>
                        <
td>&nbsp;td>
                    tr>
                    <
tr>
                        <
td>&nbsp;<a href="mailto:">a>td>
                    tr>
                    <
tr>
                        <
td>&nbsp;td>
                    tr>
                    <
tr>
                        <
td>Email: <a href="mailto:">a>td>
                    tr>
                table>
                td>
                <
td valign="top">
                td>
            tr>
            <
tr>
                <
td valign="top"><u><b>Member Pagesb>u>td>
                <
td valign="top"><u><b>My Accountb>u>td>
                <
td valign="top"><u><b>Informationb>u>td>
            tr>
            <
tr>
                <
td valign="top">
                
                <
table border="0" width="100%" cellspacing="0" cellpadding="5">
                    <
tr><td>
                        <
img src="images/arrow_right.gif" alt="">&nbsp;<a target="_blank" href="uploads/members/financials/.xls">Financialsa>td>
                    tr><tr><td>
                        <
img src="images/arrow_right.gif" alt="">&nbsp;<a target="_blank" href="uploads/members/pnl/.xls">Profit/Lossa>td>
                    tr><tr><td>
                        <
img src="images/arrow_right.gif" alt="">&nbsp;<a href="index.php?module=pxPDFManager&type=user&private=1">Recommendationsa>td>
                tr>table>
                
                
Become a full member today!<br /><br />Call ABS and tell them your interested in becoming a full member!<br /><br />(309)-691-5706!
                        
                td>
                <
td valign="top">
                <
table border="0" width="100%" cellspacing="0" cellpadding="5" id="table2">
                    <
tr>
                        <
td>            
                            &
nbsp;<a href="user.php?op=edituser" title="Edit your Profile">Edit Profilea>
                        td>
                    tr>
                    <
tr>
                        <
td>            
                            &
nbsp;<a href="index.php?module=ChangePassword" title="Change Your Password">Change Passworda>
                        td>
                    tr>
                    <
tr>
                        <
td>
                            &
nbsp;<a href="user.php?module=User&op=logout">Logouta>
                        td>
                    tr>
                table>
                td>
                <
td valign="top">
                <
table border="0" width="100%" cellspacing="0" cellpadding="5" id="table2">
                    <
tr>
                        <
td>            
                            &
nbsp;<a href="pxPDFManager.htm" title="ABSReports">ABSReportsa>
                        td>
                    tr>
                    <
tr>
                        <
td>            
                            &
nbsp;<a href="PNphpBB2-viewforum-f-1.htm" title="Forum">Foruma>
                        td>
                    tr>
                table>
                td>
            tr>
        table>
        td>
    tr>
table>

<
div align="center">
You Are Not Authorized To View This Content.
div>

4
LazyBadger
Re: Advanced Theming?

Well... you can use business-logic inside templates, but... every block have corresponding php-file, which prepare data for it.. maybe it's better place for added logic?!
And if you use user's template-set, you'll not lost your changes in presenration after updating module (sorry, can't grok logic from your template-example, because as I mentioned before i'm zero in PN)

5
MACscr
Re: Advanced Theming?
  • 2005/5/12 6:00

  • MACscr

  • Just popping in

  • Posts: 20

  • Since: 2005/5/10


oh, i would never allow users to pick their theme. Thats really only good for personal sites. Also, I dont develope for anyone except myself or my clients, so i could careless about distributing my changes. Im not saying i dont develope modules, etc for the community. Just as far as theming and layout I think people should be original. Also, putting the logic in the templates instead of the php files means i can upgrade the php files with the newest releases without worrying about losing my changes.

Login

Who's Online

318 user(s) are online (199 user(s) are browsing Support Forums)


Members: 0


Guests: 318


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits