Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Question about metatemplate
Question about metatemplate
Question about metatemplate
Hi,
I used metatemplate for basic change template and works great.
Today i'm wondering a specific action and how to... And try to explain the situation for me !
i use JMSMultisite (component to create multisite and sharing between this different sites). I share K2 component, so that my groups and categories were replicate in every subsite. To simplify the idea, I make a subsite for each K2 categorie.
When done, all my sub-sites share the K2 items that's to say a K2 item is replicate on every subsite.
So my question is, is there possible to metatemplate to redirect a categorie to a subdomain automatically ?
Let's get an exemple with two site.
I've my mastersite.com and one subsite subsite.mastersite.com
2 categories in K2 (being shared entirely) : CAT1 and CAT2 with several ITEMS1,2,3... (So in each site, item exists)
ex:
mastersite.com/CAT1
subsite.mastersite.com/CAT1
mastersite.com/CAT1/ITEM1
subsite.mastersite.com/CAT1/ITEM1
...
It is possible to redirect mastersite.com/CAT1/ITEM1 => subsite.mastersite.com/CAT1/ITEM1
OKAY, to do this page by page, there is no problem...
Is this possible to redirect automaticaly all items of CAT1 (and CAT1) to subsite.mastersite.com/XXXXXXXXXX and get it work
CAT2 => subsite2.mastersite.com/XXXXXX (that's to say not say "comK2" redirect
AND HOW TO ??
P.S: I expect i'm clear in my explanation ! (i'm french, sorry if it doesn't)
Re: Question about metatemplate
After exploring all your greats tips on the forum, and little search on google and tons of forum... I've got it !
=> PHP :
if ($option == "com_k2" and $view == "item") {
$query = "select c1.id as id1, c2.id as id2, c3.id as id3 from #__k2_items i
left join #__k2_categories c1 on i.catid = c1.id
left join #__k2_categories c2 on c1.parent = c2.id
left join #__k2_categories c3 on c2.parent = c3.id
where i.id = " . ( (int) $id ) ;
$db->setQuery( $query );
$catids = $db->loadRow();
if ( is_array( $catids ) ) {
if ( in_array( 2, $catids ) ) return true;
}
}
=> FALSE
and => RUN PHP :
$app = &JFactory::getApplication();
$url = 'http://SUBSITE.SITE.com/' . $_SERVER['REQUEST_URI'];
$app->redirect("$url");
Hope this will help others !
Great component, didn't think i could go so far with it when i download it ! (only for change basic template at first)
Re: Question about metatemplate
Hey that's really great - thanks for sharing the solution
Sorry I wasn't able to reply earlier. I've been travelling overseas for the last 3 weeks on business and have got a bit behind on the forum and e-mail support - sorry.
Cheers,
Stephen
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » Question about metatemplate
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5965
- Posts this week:
- 4
- User Info:
- Total Users:
- 8011
- Newest User:
- ignac84502
- Members Online:
- 0
- Guests Online:
- 294
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked