Template breaks URLs Topic is solved

General questions relating to Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
Rob Parker
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Jan 23, 2012 2:06 am

Template breaks URLs

Post by Rob Parker » Sat Apr 27, 2024 6:01 am

I'm doing final testing on a localhost copy of our website in preparation for the upgrade from J!3 to J!4. The localhost is running XAMPP, with PHP 8.2.4.

The upgrade to J!4.4.4 seems to have been successful, and the site runs with the default Cassiopeia template. However, if I change to the template we wish to use - tc_blp, a custom template built with Template Creator CK - the site fails, with a message "Invalid code 0 (probably an internal error)". It shows (in Quirks Mode) minimal content; within that, all the links from menu items are missing the sitename (blp) in the URL. For example, the Join Us page link is https://localhost/join-us; it should be https://localhost/blp/join-us. Developer tools reveals that most content has not loaded, for the same reason.

This behaviour occurs regardless of whether SEF Friendly URLs are set. SEF URLs work with the Cassiopeia template; however, they require the following entry in .htaccess:
RewriteBase /blp
That setting does not change the behaviour when the tc_blp template is active; the URLS are still broken.

Additional info: The localhost/blp site was set to use the Beez template before the J!4 upgrade, and the tc_blp template was installed after the upgrade. The tc_blp template was developed on our J4 testsite, currently running J4.4.4; it is working there with SEF URLs, and RewriteBase is not set in .htaccess. You can view that site here: https://j4.birdlifephotography.org.au/

Any suggestions gratefully received,

Rob

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9874
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Template breaks URLs

Post by AMurray » Sat Apr 27, 2024 6:59 am

Do you need to update to the latest Template Creator CK specifically for J4? (the developer site indicates this as v5.4.6).

We can't see your "localhost" site since it's local to your computer and not online.

This should probably be a question for the makers of Template Creator CK and since it's a paid prduct you shoud be entitled to support.
Regards - A Murray
General Support Moderator

Rob Parker
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Jan 23, 2012 2:06 am

Re: Template breaks URLs

Post by Rob Parker » Sat Apr 27, 2024 7:33 am

Thanks for your thoughts, AMurray. The version of Template Creator we are using is not the current one, but it does produce templates for J4. Our support period for this product has expired. You can see that this template runs under J4 from our test site: https://j4.birdlifephotography.org.au/

Mr. Wimpy
Joomla! Explorer
Joomla! Explorer
Posts: 464
Joined: Fri Dec 02, 2005 10:46 am
Location: The Netherlands

Re: Template breaks URLs

Post by Mr. Wimpy » Sat Apr 27, 2024 8:13 am

Join-us (and Member login) are in a custom module.

How did you create these links?

What editor do you use?
In both TinyMCE and JCE you can create links to menu-items.
This will make links respect the root no matter what directory the site is in.

Rob Parker
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Jan 23, 2012 2:06 am

Re: Template breaks URLs

Post by Rob Parker » Sat Apr 27, 2024 8:30 am

I use JCE Pro as my editor. However, the links which are broken are the menu items themselves, not links within an article.

Mr. Wimpy
Joomla! Explorer
Joomla! Explorer
Posts: 464
Joined: Fri Dec 02, 2005 10:46 am
Location: The Netherlands

Re: Template breaks URLs

Post by Mr. Wimpy » Sat Apr 27, 2024 9:11 am

How did you create the links inside the custom module?

With JCE, when you create link, you also have the option to select a menu-item where a link should lead to.

Rob Parker
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Jan 23, 2012 2:06 am

Re: Template breaks URLs

Post by Rob Parker » Sat Apr 27, 2024 9:34 am

The link is not in the custom module. The link - with the missing sitename - is in the menu item which opens the custom module.

Mr. Wimpy
Joomla! Explorer
Joomla! Explorer
Posts: 464
Joined: Fri Dec 02, 2005 10:46 am
Location: The Netherlands

Re: Template breaks URLs

Post by Mr. Wimpy » Sat Apr 27, 2024 1:19 pm

Oh wait, I was looking at the links at the top right. I had not noticed the menu at the bottom right.

Rob Parker
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Jan 23, 2012 2:06 am

Re: Template breaks URLs

Post by Rob Parker » Sat Apr 27, 2024 2:05 pm

OK. But if you're using the test site (https://j4.birdlifephotography.org.au/) which you can see to solve my problem, that won't necessarily help. As I said, that site has the same template and Joomla version as the site on my localhost, which is where the problem exists. What I'm wanting is an explanation of why this combination of template and Joomla version fails on my localhost - or even some suggestions as to what might be the problem, even if you don't have a definitive solution - when it works perfectly on our test site.

In essence, my question is: what can cause the sitename to not be included in links generated from Joomla menu items? Why does a link which should be https://localhost/blp/photo-gallery appear as https://localhost/photo-gallery ?

sclg
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 130
Joined: Mon Nov 06, 2006 7:46 pm
Location: Gloucestershire, UK

Re: Template breaks URLs

Post by sclg » Sat Apr 27, 2024 3:33 pm

I presume you have set the Joomla version setting within Template Creator to J4, not J3?
Not doing so can cause this error.
Page - Informations - Joomla Setting in the current version.

Rob Parker
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Jan 23, 2012 2:06 am

Re: Template breaks URLs

Post by Rob Parker » Sun Apr 28, 2024 4:01 am

Definitely set to Joomla! 4.x

sclg
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 130
Joined: Mon Nov 06, 2006 7:46 pm
Location: Gloucestershire, UK

Re: Template breaks URLs

Post by sclg » Sun Apr 28, 2024 11:03 am

I'd talk to Template Creator support then. Cedric is extremely responsive and helpful.

Rob Parker
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Jan 23, 2012 2:06 am

Re: Template breaks URLs

Post by Rob Parker » Sun Apr 28, 2024 11:40 am

I'm now doing that. He's been very helpful in the past.

Rob Parker
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Mon Jan 23, 2012 2:06 am

Re: Template breaks URLs

Post by Rob Parker » Mon Apr 29, 2024 11:57 pm

I finally decided to re-try the whole upgrade again. Installed another copy of our J3 site on my localhost, and ran the upgrade. No problem, with Cassiopeia template after upgrade. Installed tc_blp template, and now no problem. Cedric has not seen my problem previously, and does not know definitely what caused it; he suggests it could have been an incompatible extension which is used in a module whose position does not exist in Cassiopeia, but is only in tc_blp. I'm not sure about that; I think I removed all extensions with warnings in the pre-update check before the upgrade; but maybe I missed on.

Bottom line (for me) is that the problem has gone away.


Post Reply

Return to “General Questions/New to Joomla! 4.x”