?
avatar ciar4n
ciar4n
7 Aug 2020

Steps to reproduce the issue

Unable to use addCustomTag().

Add the following within the head tag of the frontend template.

<?php 
$document = JFactory::getDocument();
$document->addCustomTag('<style>body {transform: rotate(180deg)}</style>'); 
?>

Expected result

Page displays upside down

Actual result

No change

System information (as much as possible)

Additional comments

avatar ciar4n ciar4n - open - 7 Aug 2020
avatar joomla-cms-bot joomla-cms-bot - change - 7 Aug 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 7 Aug 2020
avatar SharkyKZ
SharkyKZ - comment - 7 Aug 2020

$document is undefined. Inside template files you should use $this->addCustomTag() because $this is the current document.

avatar ciar4n ciar4n - change - 7 Aug 2020
The description was changed
avatar ciar4n ciar4n - edited - 7 Aug 2020
avatar ciar4n ciar4n - change - 7 Aug 2020
Title
[4.0] Call to a member function addCustomTag() on null
[4.0] Unable to use addCustomTag()
avatar ciar4n ciar4n - edited - 7 Aug 2020
avatar ciar4n
ciar4n - comment - 7 Aug 2020

@SharkyKZ Yep my bad. I have updated the testing details and results. Still an issue regarding addCustomTag().

avatar SharkyKZ
SharkyKZ - comment - 7 Aug 2020

Are you still getting the same issue?

avatar ciar4n
ciar4n - comment - 7 Aug 2020

No error message but the custom tag is still not added.

avatar SharkyKZ
SharkyKZ - comment - 13 Aug 2020

I can't reproduce the issue and I suspect you're not using Cassiopeia. Maybe Lightning?

avatar ciar4n ciar4n - change - 24 Aug 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-08-24 12:55:34
Closed_By ciar4n
avatar ciar4n ciar4n - close - 24 Aug 2020
avatar ciar4n
ciar4n - comment - 24 Aug 2020

Issue was on Cassiopeia. I'll close this. It can be re-opened if replicated.

Add a Comment

Login with GitHub to post a comment