Two templates in ONE theme? Two templates in ONE theme?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Two templates in ONE theme?

Started by photo2pictures, October 18, 2010, 09:18:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

photo2pictures

Can I have a template for GUESTS and a template for ADMIN/REGISTERED users? I need one type of template layout for GUESTS and another type of template layout for ADMIN/REGISTERED, and the change between the two layouts must happen automatically at login and logout.

Is it possible?
Have expertise in HTML and CSS, but PHP is still a bit unclear for me...

Αndré

Of course you can check if a user is currently logged in and display different content. Not sure what exactly you mean with the word 'template'.

photo2pictures

What I mean with "two templates" is, that you have the default template.html in your theme folder and CPM distributes this template when a visitor hits the site. If a user choose to login, CPM could distribute another template, for example "template2.html" (still from the same theme folder). There is a left column, the content and a right column, and the situation could be, that I wanted the right column to disappear and change the layout from a 3-column to a 2-column layout, when a user logs in.
Have expertise in HTML and CSS, but PHP is still a bit unclear for me...

Αndré

I don't know if/how that works. Maybe it's the wrong approach. I'd add all columns by default and just remove the third column if the user is a guest. Or maybe just use placeholders for your additional columns and populate them if a registered user visits the gallery.