It is currently Fri Aug 29, 2008 6:02 am

Is it okay to use an Itemid this way?

General questions relating to Joomla! There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.

Is it okay to use an Itemid this way?

Postby mcsmom on Thu Jul 27, 2006 5:27 pm

I have what is for me a complicated project in which I have two different templates on the same joomla installation. I want people who come to the site via a redirect from subdomain1.mysite.org to always see one template and people who come from subdomain2.mysite.org to always see the other template. 

I've done pretty well, but I have some places where I could not figure out how to get the right template because there was not a fixed menu link. In particular, I am using the great/torturous lmtg_myhomepage which creates a separate link for each user using $my.  Usually, you either access the page through the myhomepage menu module (which isn't really a joomla menu, it is just an ordered list of the users pages) or through a link in content using moslate. That is to say, no real menu link. So then my problem is: how can I assign the template to these pages?

i realized that the problem (or at least one problem) is no itemid. So, after struggling with it for a while, I came up with making the link (a url link and/or a link in a content page) and putting an itemid from a page with the right template at the end. It works--but this can't possibly be a good idea, can it?
Read your words before posting and think about how other people will read them. Be polite. Be kind. Be constructive. Say thank you.
User avatar
mcsmom
Joomla! Virtuoso
Joomla! Virtuoso
 
Posts: 4852
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York

Re: Is it okay to use an Itemid this way?

Postby AmyStephen on Sat Jul 29, 2006 9:31 pm

That is complicated. I have been messing around with it myself.

The one thing I wish we could do is have either domain redirect to it's own file, which then would redirect to a Joomla! page and establish a menubar of its own that has the "custom" home page.

The only trouble is that shared pages (most of your website) will not know which menu to use (with it's own home page and its own ItemID, therefore, it could have its own template.) I keep rolling that around -- and wonder if a little, tiny hack in the module area might be okay. (I do not believe in hacks. This would honestly be a first. I don't like them.)

+++

Otherwise, I am not familiar with these tools but, the process you are describing makes sense to me. And, I can't think of a better one. I am going to keep thinking about my idea above, but I wanted you to know that I have not ignored this. But, rather, you stuck it into my mind, now it won't leave! lol ... So, I'll come back, later, too. < The honor of answering a question for MCSMom is too great to pass up, trust me. She has always been my Joomla! hero since I started! >

TTYL....Thanks! Amy
AmyStephen
 

Re: Is it okay to use an Itemid this way?

Postby mcsmom on Sun Jul 30, 2006 12:47 am

The thing is, how do I conceptualize myhomepage? Are they each separate pages? Or is it one page with content that varies? And how do I generate an itemid without hard coding a menu item for each and every person, which defeats the beauty of having it dynamically generated.

It works to do what I said, but it feels wrong.
Read your words before posting and think about how other people will read them. Be polite. Be kind. Be constructive. Say thank you.
User avatar
mcsmom
Joomla! Virtuoso
Joomla! Virtuoso
 
Posts: 4852
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York

Re: Is it okay to use an Itemid this way?

Postby AmyStephen on Sun Jul 30, 2006 1:26 am

I think the trick is knowing what the original referrer was -- which sudomain subdomain1 or subdomain2 did you come from.

If that information was known THE ENTIRE TIME the visitor was on your site, I was conceptualizing a different home menu item for each subdomain. That menu item would produce the appropriate home page.

However! We do not have a session variable that would tell us the referrer (i.e., subdomain1 or 2); further, we have no ability to map menu items based on a session variable which might hold that value.

These ideas would require hacks to the code - which I do not ever think is a good idea - and MUCH more thought on the ramifications of not having ItemID = 1 for each home page (ex. breadcrumbs will be impacted).

++++

How many people are we talking about here?

Edit: How could the template chooser be used to aid in this? How are they going to sign-up?
Last edited by AmyStephen on Sun Jul 30, 2006 1:28 am, edited 1 time in total.
AmyStephen
 

Re: Is it okay to use an Itemid this way?

Postby mcsmom on Sun Jul 30, 2006 10:25 am

Playing around with template chooser is an interesting idea.

You are right about the session variable.
Read your words before posting and think about how other people will read them. Be polite. Be kind. Be constructive. Say thank you.
User avatar
mcsmom
Joomla! Virtuoso
Joomla! Virtuoso
 
Posts: 4852
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York

Re: Is it okay to use an Itemid this way?

Postby ircmaxell on Sun Jul 30, 2006 10:28 am

Simple... Make two different codebases (one for each subdomain) pointing to the same db... then just edit index.php and index2.php so the template is hard coded into it (instead of getting default from db)...
Anthony Ferrara - Core Team - Development Coordinator - Bug Squad - JSST

Make sure you're posting in the correct forum... http://forum.joomla.org/viewtopic.php?f=433&t=230005
http://www.joomlaperformance.com For All Your Joomla Performance Needs
User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
 
Posts: 1673
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA

Re: Is it okay to use an Itemid this way?

Postby mcsmom on Sun Jul 30, 2006 10:35 am

Yes, you could do that, but it creates certain other problems, notably two people could be editing the same content at the same time.
Read your words before posting and think about how other people will read them. Be polite. Be kind. Be constructive. Say thank you.
User avatar
mcsmom
Joomla! Virtuoso
Joomla! Virtuoso
 
Posts: 4852
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York

Re: Is it okay to use an Itemid this way?

Postby ircmaxell on Sun Jul 30, 2006 12:10 pm

mcsmom wrote:Yes, you could do that, but it creates certain other problems, notably two people could be editing the same content at the same time.
Nope, as content locking is done from the database side.  The only problem that would arrise, is durring upgrades and component installation. 

An even better solution would be to simlink every directory, and every file in the root directory but index.php and index2.php from one subdomain to the other...  That way, in reality, you are only dealing with one codebase... WOW, this gives me an interesting idea!
Anthony Ferrara - Core Team - Development Coordinator - Bug Squad - JSST

Make sure you're posting in the correct forum... http://forum.joomla.org/viewtopic.php?f=433&t=230005
http://www.joomlaperformance.com For All Your Joomla Performance Needs
User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
 
Posts: 1673
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA

Re: Is it okay to use an Itemid this way?

Postby mcsmom on Sun Jul 30, 2006 12:39 pm

Go for it!
Read your words before posting and think about how other people will read them. Be polite. Be kind. Be constructive. Say thank you.
User avatar
mcsmom
Joomla! Virtuoso
Joomla! Virtuoso
 
Posts: 4852
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York


Return to General Questions - 1.0.x

Who is online

Users browsing this forum: dokterj and 7 guests