Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
two themes on cms
#1
Hello, is there any way to have two themes and one get-simple installation? For example, we want to display the page contents into two different styles/themes at the same time. When we edit one, we want it to edit both.

Thanks in advance.
Reply
#2
Absolutely! Just create a session variable for your users to determine which theme to view. Shouldn't be too hard.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#3
What do you mean by using two themes at the same time? Would you like to display the same page two times at once?

If you just want to be able to choose a different mark up on a per page basis you can have multiple template files in your theme folder. You’ll be able to choose any of these for a page under the page options button.

Edit: if you meant what internet54 said, yes, sessions will be a way to give users a choice what style to use.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#4
I want it so if a user goes to mydomain.com/hello they are displayed one style, if they visit mydomain.com/hello2 they are displayed a different style, and I want to go to mydomain.com/cms to edit the info on both hello / hello2 at the same time. The information is the same, example, it says "hello guest" on both of them, i want to login and change "hello guest" to "goodbye once and it changes on both sites / styles.
Reply
#5
Something like that would currently be impossible to do dynamically. That’s not to say it can’t be done.

You can create 2 different template files. A normal one and one for the second theme. Instead of the normal get_content() function in the second template file you put in code that will call the contents from the page “hello”. Now you go to the pages panel and add 2 pages, “hello” and “hello2”. You can fill the content field of the hello-page and at the hello2-page you’ll need to select the second template file under page options.

The result should be 2 pages, the second one showing the same content as the first one, of which the text is always as written on the first page. The style can be different because you’re using two different template files. The reason I said it won’t be dynamic is because you’ll need to hard code what content you want to show. Unless of course you are going to have some sort of pattern in the URL, because than you could try to match against that.

Good luck.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#6
Your best bet is to setup two instances. You could write a php script that copies the data folder from one folder to the next after you update a page so that the info in install2 stays identical and current with install1.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#7
There's no way to hard code a php page to get info from the xml structure? so that page a and page b both read from the same get_content ?
Reply
#8
You could, or just save some time and use a database system instead. There's no point in modifying GS into something it wasn't built to do. You should look into a MySQL based setup.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#9
yes but i really like get-simple. I'm really just trying to do something pretty basic. One site content for two different designs. We want to display a different design depending on the users screen / OS but we want the content to stay the same. Easiest way to do this is have the get-contents show up on two different template.php pages. So basically we want two active template.php instead of one. We will send the viewers to template1.php or template2.php on our own, we just need to know how to put the info into those templates.
Reply
#10
Sounds like the exact same thing as I was developing for the iPhone theme. In the end, you’ll need your template.php file to have PHP code that makes the switch—a simple if-clause. In the first clause you include your template1.php and in the second clause your template2.php. Then your theme is making the choice based on the OS (as far as you can be sure of the OS).

Please do keep in mind though that it is very hard to correctly tell the users OS in PHP, and completely impossible to check their screen information. This latter, if you really must check it, has to be checked with Javascript. As Javascript can only run on an actually loaded page you won’t be able to send them to a different layout without a page already loading.

Yes, it is possible to with one GetSimple installation run different themes.
No, it will not be “something pretty basic.”
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#11
We have the php script to make the switch we just need get-simple to be outputting the same contents to two pages, we will detect and send the user to mydomain.com/template2.php or mydomain.com/template1.php, we just want both of those pages to display information from template.php, when the user logs into getsimple admin he/she can edit the information normally and it automatically is updated on both templates. If this is not a tweak/function which can be explained, is anyone interested in freelancing it to us?
Reply
#12
Are these on the same domain?
If so then your looking at a VERY simple modification.

If these are on two separate domain names, then that is where the problem may lay.
However, the $_SERVER superglobal should help that matter.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#13
It could be done in one template.php file…
Code:
if (switch_criteria()==true) include('template1.php');
else include('template2.php');
That should pretty much cover it all.

mobiten Wrote:If this is not a tweak/function which can be explained, is anyone interested in freelancing it to us?
I guess I’m available. If you already have the function that splits your users in to the two different target groups it can probably be done in about an hour or so. I’ll bill you $9 though ;-)
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#14
yes these are on the same domain.

Basically the user will go to mydomain.com/index.php we will detect the user based on some attributes and either send them to mydomain.com/getsimple/template1.php or mydomain.com/getsimple/template2.php. We want to be able to go into mydomain.com/getsimple/admin and edit the page and it changes the info on both template1 and template2.
Reply
#15
Don’t send them to two different template files, it will just mess up the links generated by GetSimple. If your check is in PHP your actual theme files can do all rerouteing for you and every page will automatically adapt to the visitor without having to send him to a different URL.

It will work something like this:
User 1 goes to http://example.com/a-page. GetSimple checks the back-end to see what content to display, then it goes on to call the template file. Your template file checks that User 1 is using a certain screen and serves him a template with a width of 1000px. User 1 now wants to share this page with User 2 and copies the URL.

User 2 visits http://example.com/a-page after receiving it from User 1. GetSimple checks the back-end to see what content to display, then it goes on to call the template file. Your template file checks for a certain screen again and sees User 2 is using an old one, now the template file will serve a template with a width of 600px. User 2 is just as happy as User 1 and has access to the same content.

The above scenario is very possible, I’ve done some work exactly like this with the iPhone theme. The thing there was to serve a special iPhone template to browsers identifying themselves as Mobile Safari on the iPhone.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#16
Whew, this topic would have been easier to follow if you said the domain.com/folder was always going to be the same. Now that I fully understand what you want to do, it's a piece of cake. Hire Ziggy and "he" will do get it done all proper-like.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#17
Why don't you set a COOKIE SESSION variable in PHP then check the value of that cookie.

for example if the value = 1, then show one CSS file, if it = 2, then show a different CSS file. This is assuming that the changes you are looking for are strictly CSS based. Of course there are a lot of different things you can do with CSS, so i think this possibility is endless.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#18
Thanks for all your help.

Within get-simple i don't want it to be different template per getsimple, i am actually removing the option to change "templates" etc, I was using the name template as an example.

We have to send the user to different urls for internal reasons. So let me rephrase:
We want the user to do to mydomain.com/index.php, we will detect and sent the user to either: mydomain.com/site1.php or mydomain.com/site2.php. There is no changing this. We are doing it for A/B testing of the layout but the text content will be the same!

In both of those sites, we want the getcontents functions to be editable in one instance in getsimple. so the user would log into mydomain.com/admin and edit site contents and it will change on both site1.php and site2.php.

Make sense?
Reply
#19
You need two different URLs? That doesn’t really make sense as you could easily log when you serve the first and when the second template…

The way you want it now seems pretty complicated. Maybe copying GetSimple’s index.php to 2 different files (site1.php and site2.php) both with a hard-coded template variable. No guarantees there, I’ll need to run some test with that first.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#20
yes sorry two different url's are required.
Reply
#21
Will you need Fancy URLs to work? That will complicate things a lot more. If not I’ll give it a try…

mobiten Wrote:yes sorry
Nothing to apologise for, just something I think is a bit odd.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#22
fancy URLs are not needed.
Reply
#23
mobiten Wrote:fancy URLs are not needed.
Great, then I think I can actually get this set up!

Current status; it has been surprisingly easy to use two different PHP files that both run on exactly the same GetSimple back-end. Though I find the method a tad repulsive as it goes against so many GetSimple principals. Currently it’s build on duplicate data, the shame, but I might fix that soon. As a sign of my “disgust” (loose definition) I called this little thing Morbid.

Visit Morbid and you’ll see you are redirected to a file ending on -theme.php. The system bases the theme choice on how many seconds have passed since the Unix Epoch, meaning that a different redirect is given per 10 seconds. Currently I only have it configured with the two standard themes that ship with GetSimple. Just press the Home link, after 10 seconds, to see yourself redirected to the other theme.

The fact that the home link does this is bad. The menu is based on thinking that GetSimple runs from index.php instead of from our *-theme.php files, this is also why the second page link wont work. I’ll get this updated so the menu will know to use the *-theme.php file that is currently displayed. I guess it’s a good thing I have some experience with recoding the menu function.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#24
heh I am sorry to go against any get simple principals however I can assure you this isn't being used for any type of unethical projects, its simply being used for A/B marketing purposes. We will have different layouts with analytics on the pages, the content is the same however the placement of the contents and images will vary on the pages. Which is one reason we want different urls rather than css changes on the same page. We are also only creating three different styles max, so we aren't mass producing pages with the same content.
Reply
#25
Well, as you see (if you looked) I am able to build something like that…

If you haven’t figured it out yourself yet: would you want me to try and write up the exact steps to take, or follow internet54’s advice and “hire” me?
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply




Users browsing this thread: 1 Guest(s)