Special front-end template for admins?

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
User avatar
Oskar Rough
Forum Members
Forum Members
Posts: 40
Joined: Tue Aug 26, 2008 9:45 pm
Location: Denmark

Special front-end template for admins?

Post by Oskar Rough »

Hi,

I'd like to test a new template for my site. How do I enable this template for me and only for me?
Coldman
Power Poster
Power Poster
Posts: 318
Joined: Sun Jun 22, 2008 5:33 am

Re: Special front-end template for admins?

Post by Coldman »

You could make it hard by install FEU etc.....

One easy solution is to create a new page with that new theme and then uncheck Show in menu:
Then just go to www.yourdomain.com/NEWPAGE
Important Code of Conduct
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
User avatar
Oskar Rough
Forum Members
Forum Members
Posts: 40
Joined: Tue Aug 26, 2008 9:45 pm
Location: Denmark

Re: Special front-end template for admins?

Post by Oskar Rough »

FEU?

Yeah, true that's an option although it's only one page and not the entire site. (This specific site only uses one single template for all pages.)
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Special front-end template for admins?

Post by jmcgin51 »

you could check the IP address of the visitor, and show them the special template if the IP address matches the IP address of an admin, otherwise show the normal template.
User avatar
Oskar Rough
Forum Members
Forum Members
Posts: 40
Joined: Tue Aug 26, 2008 9:45 pm
Location: Denmark

Re: Special front-end template for admins?

Post by Oskar Rough »

jmcgin51 wrote: you could check the IP address of the visitor, and show them the special template if the IP address matches the IP address of an admin, otherwise show the normal template.
Sounds like a solution :) Do you mind starting me with a link or code to change template?
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Special front-end template for admins?

Post by jmcgin51 »

Well, it looks like I shot my mouth off a little early, because you can't do it as easily as I thought you could.  I thought you could pass the desired template id in the URL, like "yoursite.com/index.php?page=abc&templateid=42", which would make your job very easy.

But to start off, take a look at this thread:
forum.cmsmadesimple.org/index.php/topic,19028.15.html
specifically Sonya's post about halfway down.  If you implement this hack, you should then be able to use some logic at the beginning of the default page template (that everyone else would see), like

{if $page_alias=xyz}
add redirect code to the URL calling the different template, i.e. yoursite.com/index.php?tpl_id=21
{/if}
rest of normal template

UNTESTED, AND REMEMBER THAT HACKS OF THE SOURCE CODE MEAN THAT YOUR SITE IS ESSENTIALLY NOT SUPPORTABLE.  Use at your own risk.
forum.cmsmadesimple.org/index.php/topic,28132.0.html

There is probably a better/easier/faster/sexier way to do this...
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Special front-end template for admins?

Post by calguy1000 »

Oskar wrote: Hi,

I'd like to test a new template for my site. How do I enable this template for me and only for me?
Why not just:
a) copy a page
b) specify that the new page should use the new template
c) uncheck the 'show in menu' link
d) click submit
e) click the view icon.
You now have a brand new, hidden page to test your new template with.

There are many complexities in dynamically changing the template ID wrt the page id, particularly related to additional content blocks, etc. That would cause many users to become extremely confused if we added this functionality... therefore we allow hidden pages.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “[locked] Installation, Setup and Upgrade”