Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

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 wink

AND HOW TO ?? smile


P.S: I expect i'm clear in my explanation ! (i'm french, sorry if it doesn't)

titus
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

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 ! wink
Great component, didn't think i could go so far with it when i download it ! (only for change basic template at first)

titus
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Question about metatemplate

Hey that's really great - thanks for sharing the solution smile

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

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4388
Newest User:
wilmer7878
Members Online:
1
Guests Online:
198

Online: 
wilmer7878

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked