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.

<!--[pnusergetvar name=uid assign="checkuid"]-->
<!--[if 
$checkuid eq $uid or pnSecAuthAction(0"advProfile::""::"ACCESS_ADMIN)]-->
<!--[if 
pnSecAuthAction(0"advProfile::""::"ACCESS_ADMIN)]-->
  <!--[
assign var="auth" value=true]-->
<!--[else]-->
  <!--[
assign var="auth" value=false]-->
<!--[/if]-->
<
table border="0" width="100%" cellspacing="0" cellpadding="0">
    <
tr>
        <
td><b>&nbsp;&nbsp;&nbsp;<span class="pn-title">Client Account Information for <!--[$FIRSTNAME_VALUE|pnvarprephtmldisplay|pnvarcensor]-->&nbsp;<!--[$LASTNAME_VALUE|pnvarprephtmldisplay|pnvarcensor]--></span></b>
                        <!--[if 
$checkuid eq $uid or $auth eq true]-->
                            <!--[if 
$auth eq true]-->
                                &
nbsp;(<a href="admin.php?module=User&amp;op=modifyUser&amp;chng_uid=<!--[$uid]-->&amp;authid=<!--[$authid]-->">ADMIN EDIT</a>)
                            <!--[/if]-->
                            <!--[else]-->
                                <!-- 
HIDE ME -->
                        <!--[/if]-->
</
td>
    </
tr>
    <
tr>
        <
td>
        </
td>
    </
tr>
    <
tr>
        <
td>
        <
table border="0" width="100%" cellspacing="5" cellpadding="5">
            <
tr>
                <
td valign="top"><u><b>Contact Info</b></u></td>
                <
td valign="top"><u><b>Recent Forum Posts</b></u></td>
            </
tr>
            <
tr>
                <
td valign="top">
                <
table border="0" width="100%" cellspacing="0" cellpadding="0" id="table1">
                    <
tr>
                        <
td>User:&nbsp;<!--[$USERNAME_VALUE|pnvarprepfordisplay|pnvarcensor]--></td>
                    </
tr>
                    <
tr>
                        <
td><!--[pnml name="_TRADENUM"]-->&nbsp;<!--[$TRADENUM_VALUE|pnvarprephtmldisplay|pnvarcensor|default:"N/A"]--></td>
                    </
tr>
                    <
tr>
                        <
td>&nbsp;</td>
                    </
tr>
                    <
tr>
                        <
td><!--[$FIRSTNAME_VALUE|pnvarprephtmldisplay|pnvarcensor]-->&nbsp;<!--[$LASTNAME_VALUE|pnvarprephtmldisplay|pnvarcensor]--></td>
                    </
tr>
                    <
tr>
                        <
td><!--[$STREET1_VALUE|pnvarprephtmldisplay|pnvarcensor|default:"N/A"]--></td>
                    </
tr>
                    <
tr>
                        <
td><!--[$STREET2_VALUE|pnvarprephtmldisplay|pnvarcensor]--></td>
                    </
tr>
                    <
tr>
                        <
td><!--[$CITY_VALUE|pnvarprephtmldisplay|pnvarcensor|default:"N/A"]-->, <!--[if $STATE_VALUE == 1]-->
AK
<!--[elseif $STATE_VALUE == 2]-->
AL
<!--[elseif $STATE_VALUE == 3]-->
AR
<!--[elseif $STATE_VALUE == 4]-->
AZ
<!--[elseif $STATE_VALUE == 5]-->
CA
<!--[elseif $STATE_VALUE == 6]-->
CO
<!--[elseif $STATE_VALUE == 7]-->
CT
<!--[elseif $STATE_VALUE == 8]-->
DC
<!--[elseif $STATE_VALUE == 9]-->
DE
<!--[elseif $STATE_VALUE == 10]-->
FL
<!--[elseif $STATE_VALUE == 11]-->
GA
<!--[elseif $STATE_VALUE == 12]-->
HI
<!--[elseif $STATE_VALUE == 13]-->
IA
<!--[elseif $STATE_VALUE == 14]-->
ID
<!--[elseif $STATE_VALUE == 15]-->
IL
<!--[elseif $STATE_VALUE == 16]-->
IN
<!--[elseif $STATE_VALUE == 17]-->
KS
<!--[elseif $STATE_VALUE == 18]-->
KY
<!--[elseif $STATE_VALUE == 19]-->
LA
<!--[elseif $STATE_VALUE == 20]-->
MA
<!--[elseif $STATE_VALUE == 21]-->
MD
<!--[elseif $STATE_VALUE == 22]-->
ME
<!--[elseif $STATE_VALUE == 23]-->
MI
<!--[elseif $STATE_VALUE == 24]-->
MN
<!--[elseif $STATE_VALUE == 25]-->
MO
<!--[elseif $STATE_VALUE == 26]-->
MS
<!--[elseif $STATE_VALUE == 27]-->
MT
<!--[elseif $STATE_VALUE == 28]-->
NC
<!--[elseif $STATE_VALUE == 29]-->
ND
<!--[elseif $STATE_VALUE == 30]-->
NE
<!--[elseif $STATE_VALUE == 31]-->
NH
<!--[elseif $STATE_VALUE == 32]-->
NJ
<!--[elseif $STATE_VALUE == 33]-->
NM
<!--[elseif $STATE_VALUE == 34]-->
NV
<!--[elseif $STATE_VALUE == 35]-->
NY
<!--[elseif $STATE_VALUE == 36]-->
OH
<!--[elseif $STATE_VALUE == 37]-->
OK
<!--[elseif $STATE_VALUE == 38]-->
OR
<!--[elseif 
$STATE_VALUE == 39]-->
PA
<!--[elseif $STATE_VALUE == 40]-->
RI
<!--[elseif $STATE_VALUE == 41]-->
SC
<!--[elseif $STATE_VALUE == 42]-->
SD
<!--[elseif $STATE_VALUE == 43]-->
TN
<!--[elseif $STATE_VALUE == 44]-->
TX
<!--[elseif $STATE_VALUE == 45]-->
UT
<!--[elseif $STATE_VALUE == 46]-->
VA
<!--[elseif $STATE_VALUE == 47]-->
VT
<!--[elseif $STATE_VALUE == 48]-->
WA
<!--[elseif $STATE_VALUE == 49]-->
WI
<!--[elseif $STATE_VALUE == 50]-->
WV
<!--[elseif $STATE_VALUE == 51]-->
WY
<!--[elseif $STATE_VALUE == 52]-->
AA
<!--[elseif $STATE_VALUE == 53]-->
AE
<!--[elseif $STATE_VALUE == 54]-->
AP
<!--[elseif $STATE_VALUE == 55]-->
AS
<!--[elseif 
$STATE_VALUE == 56]-->
FM
<!--[elseif $STATE_VALUE == 57]-->
GU
<!--[elseif $STATE_VALUE == 58]-->
MH
<!--[elseif $STATE_VALUE == 59]-->
MP
<!--[elseif $STATE_VALUE == 60]-->
PR
<!--[elseif $STATE_VALUE == 61]-->
PW
<!--[elseif $STATE_VALUE == 62]-->
VI
<!--[else]-->
N/A
<!--[/if]-->&nbsp;<!--[$ZIP_VALUE|pnvarprephtmldisplay|pnvarcensor|default:"N/A"]--></td>
                    </
tr>
                    <
tr>
                        <
td>&nbsp;</td>
                    </
tr>
                    <
tr>
                        <
td><!--[pnml name="_DAYPHONE"]-->&nbsp;<!--[$DAYPHONE_VALUE|pnvarprephtmldisplay|pnvarcensor|default:"N/A"]--></td>
                    </
tr>
                    <
tr>
                        <
td><!--[pnml name="_NIGHTPHONE"]-->&nbsp;<!--[$NIGHTPHONE_VALUE|pnvarprephtmldisplay|pnvarcensor|default:"N/A"]--></td>
                    </
tr>
                    <
tr>
                        <
td><!--[pnml name="_CELLPHONE"]-->&nbsp;<!--[$CELLPHONE_VALUE|pnvarprephtmldisplay|pnvarcensor|default:"N/A"]--></td>
                    </
tr>
                    <
tr>
                        <
td><!--[pnml name="_FAX"]-->&nbsp;<!--[$FAX_VALUE|pnvarprephtmldisplay|pnvarcensor|default:"N/A"]--></td>
                    </
tr>
                    <
tr>
                        <
td><!--[pnml name="_TXTMSG"]-->&nbsp;<a href="mailto:<!--[$TXTMSG_VALUE|pnvarprephtmldisplay|pnvarcensor|default:"N/A"]-->"><!--[$TXTMSG_VALUE|pnvarprephtmldisplay|pnvarcensor|default:"N/A"]--></a></td>
                    </
tr>
                    <
tr>
                        <
td>&nbsp;</td>
                    </
tr>
                    <
tr>
                        <
td>Email: <a href="mailto:<!--[pnusergetvar name="email" uid=$uid]-->"><!--[pnusergetvar name="email" uid=$uid]--></a></td>
                    </
tr>
                </
table>
                </
td>
                <
td valign="top">
                <!--[
pnblockshow module="PNphpBB2" blockname="Multiblock" block="46"]--></td>
            </
tr>
            <
tr>
                <
td valign="top"><u><b>Member Pages</b></u></td>
                <
td valign="top"><u><b>My Account</b></u></td>
                <
td valign="top"><u><b>Information</b></u></td>
            </
tr>
            <
tr>
                <
td valign="top">
                <!--[if 
pnSecAuthAction(0"clientlinks::""::"ACCESS_COMMENT)]-->
                <
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/<!--[$TRADENUM_VALUE]-->.xls">Financials</a></td>
                    </
tr><tr><td>
                        <
img src="images/arrow_right.gif" alt="">&nbsp;<a target="_blank" href="uploads/members/pnl/<!--[$TRADENUM_VALUE]-->.xls">Profit/Loss</a></td>
                    </
tr><tr><td>
                        <
img src="images/arrow_right.gif" alt="">&nbsp;<a href="index.php?module=pxPDFManager&type=user&private=1">Recommendations</a></td>
                </
tr></table>
                <!--[else]-->
                
Become a full member today!<br /><br />Call ABS and tell them your interested in becoming a full member!<br /><br />(309)-691-5706!
                <!--[/if]-->        
                </
td>
                <
td valign="top">
                <
table border="0" width="100%" cellspacing="0" cellpadding="5" id="table2">
                    <
tr>
                        <
td>            
                            <!--[
pnimg src="arrow_right.gif" alt="."]-->&nbsp;<a href="user.php?op=edituser" title="Edit your Profile">Edit Profile</a>
                        </
td>
                    </
tr>
                    <
tr>
                        <
td>            
                            <!--[
pnimg src="arrow_right.gif" alt="."]-->&nbsp;<a href="index.php?module=ChangePassword" title="Change Your Password">Change Password</a>
                        </
td>
                    </
tr>
                    <
tr>
                        <
td>
                            <!--[
pnimg src="arrow_right.gif" alt="."]-->&nbsp;<a href="user.php?module=User&op=logout">Logout</a>
                        </
td>
                    </
tr>
                </
table>
                </
td>
                <
td valign="top">
                <
table border="0" width="100%" cellspacing="0" cellpadding="5" id="table2">
                    <
tr>
                        <
td>            
                            <!--[
pnimg src="arrow_right.gif" alt="."]-->&nbsp;<a href="pxPDFManager.htm" title="ABSReports">ABSReports</a>
                        </
td>
                    </
tr>
                    <
tr>
                        <
td>            
                            <!--[
pnimg src="arrow_right.gif" alt="."]-->&nbsp;<a href="PNphpBB2-viewforum-f-1.htm" title="Forum">Forum</a>
                        </
td>
                    </
tr>
                </
table>
                </
td>
            </
tr>
        </
table>
        </
td>
    </
tr>
</
table>
<!--[else]-->
<
div align="center">
You Are Not Authorized To View This Content.
</
div>
<!--[/if]-->

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

141 user(s) are online (96 user(s) are browsing Support Forums)


Members: 0


Guests: 141


more...

Donat-O-Meter

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

Latest GitHub Commits