11 years ago
10
Topic

Hello,

unfortunately there is still the problem with the missing template style id when you are using Seblods great multisite feature. This leads to problems if you use different styles of your template for the different sites.

This small code adds the template style id to the template object. It is assumed that the $template variable is used as template object (find the "getTemplate" function to see what variable name is used).

// VMXHack Start - Make it work with Seblod Multisite
		if(!$template->id)
		{
			if (class_exists('JCck'))
			{
				// If needed:
				// $app = JFactory::getApplication();
				$vmxsite		=	null;
				$vmxsite_cfg	=	new JRegistry;
				if ( JCck::isSite() )
				{
					$vmxsite = JCck::getSite();
					$vmxsite_cfg->loadString( $vmxsite->configuration );
					if ( $app->isSite() && $vmxsite ) $template->id	= $vmxsite_cfg->get( 'template_style' );
				}
			}
		}
// VMXHack End
Get a VIP membership
11 years ago
0
Level 1

Hi Thomas :-) and Welcome!

Nice to see you here.

Thank you we will look.

Regards.

Sebastien.

11 years ago
5
Level 1

Hi, I configured my multisite setup to use one template style for each language but I get the default one instead. This code seems to be the answer to my issue but where should it go ? In the template file ? 


Best regards

11 years ago
2
Level 2

Hi!


This is difficult to say... It depends very much on the template you use. Is it one from the template clubs with the huge template frameworks? Then it might be somewhere in the framework code. The best is to do a fulltext search for "getTemplate" in the template directory (with subdirs). If you find it, this is the point to start. You have to find out the variable name that is used for the getTemplate object (in the code above it is $template). Add the code after the getTemplate-line. It might be, that there is more than one position where the getTemplate function is called (depending on you template). In this case you will have to test where to add the code...


Thomas

11 years ago
1
Level 3

Thank you for your quick answer : ). 

I'm searching this right now.

11 years ago
0
Level 4

I 'm able to get the template id, the template name, the template params but not the template style id. The template i use is Kallyas.

11 years ago
1
Level 2

I don't get it : somehow  it randomly works today (seblod 3.1.5) without any additionnal code. I randomly get the styles I assigned as configured but  sometimes, I get all the mainmenu menuitems  shown with all the assigned templates (imagine 7 footers). If I reload the page the issue disappears.

Mysterious.

11 years ago
0
Level 3

Oh I just discovered that the template style is the one I assign only when I log on the front-end. If I then refresh the page I get the default one. After that every time I refresh I get the default style instead of the assigned one till I logout and logon again.

548 Posts
joomleb
11 years ago
2
Level 1

Hi to all, thinking the "Bug" I found are something related to this issue I post here. Please, if not, let me know and I'll open a new topic.


Before to begin, Do you know "Template Creator CK" ? 

Well, it's a joomla extension that give you the way to build a template online. 

How ? Simply in the administrator you click your "CK" template and it open an editor, but it is a Frontend editor! So, if not logged, it ask you to loggin in the frontend before to open the editor.

Now, let me explain you:


I was working with Joomla 3.1.1 + Seblod 3.1.4 + Template Creator CK 3.0.12 (PHP 5.4.8 - MySQL 5.5.27)

On my MainSIte.com I set Multisite:

  • Site1.com (domain Site1.com was the same where I installed the MainSite)
  • Site2.org

All were good.


I upgraded to Joomla 3.1.5 + Seblod 3.1.5 + Template Creator CK 3.0.12 and cleared cache

  • Now if I try to open a "CK" template I have back a blank page instead of the frontend login module. I tested and this is the error message
    Notice: Trying to get property of non-object in /home/cpaneluser/public_html/plugins/system/cck/cck.php on line 313
    So I went into Joomla plugin manager and tried unpublishing the system/cck plugin that is named: "System - SEBLOD". So:
    - If plugin is unpublished Template Creator CK run without any issue!
    - If plugin is published and before to begin I login also into the frontend, Template Creator CK seem to run without any issue but a strange Template Creator CK template is shown! Seem like the Site1.com template (my MainSite.com and Site1.com in Seblod) Wrap the Temlate Creator CK editor!
  • Let me add also that when I unpublish the system/cck plugin, that is named "System - SEBLOD", all the named "SEBLOD" plugins change their names! For example the "System - SEBLOD" becomes "plg_system_cck"... Is it normal?
  • there's more! Now (logically with "System - SEBLOD" published) when I type in my URL Site2.org all seem to be ok, but if I type Site1.com I have back this error message: 403 - You are not authorized to view this resource! These happen since I'm logged in the Frontend.
  • Logically when I type, for example,  Site1.com it "redirect" to Site1.com/index.php/homeAlias ...so, I don't know why, I tried also to type Site1.com/index.php and "a strange" Site1.com template is shown! Strange because seem without links and articles!!! (This happen also if I assign the joomla default templates)
  • Last but not least, in joomla you can always have same Menu titles, but the alias must be unique, different. That's right and have a logical sense in a single site. But, whereas is the alias that is shown in the URL, so have no sense in a Multisite, I think that "every alias in Joomla must be unique" per site, because I can have (want) Site1.net/home / Site2.org/home / Site3.com/home... Right now is not possible.
    Othewise, if "every alias in Joomla must be unique" have a technical reason, I think that there must be a way to show Site1.net/home / Site2.org/home / Site3.com/home in my URL.
    PS this is not a question limited to the "home" (that I prefer if would be a way to don't show "/home" in the URL), but is a problem for all Menu! I cannot have the same alias Menu name (the alias that is shown in the URL) for different sites! No sense!

Hoping you can understand my English, if you need, I can sen you an entire MainSite Akkeba Backup...
Waiting your ideas and suggestions...

11 years ago
1
Level 2

Hi Joomleb, I think your issue is unrelated (but who really knows?...).

You should never disable a Seblod system plugin but yeah it seems there is a conflict with your template creator component.

Try with another one, a basic template like beez.

As a thumb rule start simple and when you know it works go to the more difficult customisations.

In order to be able to visit both sites your user access rights (depends on whether you are logged in or not : public / guest / user) has to be properly configured.

Going on yoursite.com/index.php leads you to the default Joomla homepage, but it is not this one you have configured to be a site homepage so it looks "strange" and that seems normal to me.

548 Posts
joomleb
11 years ago
0
Level 3

Hi ConradM, 

in first thanks for your reply,

  • "You should never disable a Seblod system plugin" = Sure, if you red my post, I unpublished the plugin to test the error message;
  • "there is a conflict with your template creator component" = the error message is clear: Notice: Trying to get property of non-object in /home/cpaneluser/public_html/plugins/system/cck/cck.php on line 313
    As I write this message appeared after the updates.
    Before to post here I yet tested the "Template Creator CK" component with the owner and all is good. 
  • "Try with another one, a basic template like beez" = I don't understand, if you red my post, is not a template problem. Created templates form "Template Creator CK" are good. However I tried changing my Site templates with the Beez template and nothing change.
  • "As a thumb rule start simple and when you know it works go to the more difficult customisations." = I don't understand, what do you mean?
  • "In order to be able to visit both sites your user access rights (depends on whether you are logged in or not : public / guest / user) has to be properly configured." = Again, I don't understand you. Right now on that site I have 7 users, 1 the default joomla Super User and 3+3 fake users automatically created from Seblod during Standard Multisite creation. Logically, I made all tests as Super User!
  • "Going on yoursite.com/index.php leads you to the default Joomla homepage, but it is not this one you have configured to be a site homepage so it looks "strange" and that seems normal to me." = Do you mean that the MainSite.com content is shown (I have no content yet) with the Site1.com template and/or MainSite.com content with the Site2.org template ? If so, Do you think is correct that run in that way?!?
I will open a new  topic for these "Bugs" waiting instructions if I have to open a Bug ticket 

Get a VIP membership