• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed The requested template could not be found - extra css

Adam Howard

Well-known member
#1
AdminCP > Appearance > Template Modifications > Create Template Modifications > Template:

Type in Extra.css

Before you even finish typing it, it will show up as an option to impute.
But you will get this notice with either selecting it.

Template Contents:
The requested template could not be found.


And thus it will not let you save anything. The TMS (Template Modification System) should work with any template.
 
Last edited:

Jeremy

Well-known member
#2
This occurs when the template HTML is empty, not just EXTRA.css. Should be easy enough to change the JavaScript that handles the response.
 

Adam Howard

Well-known member
#3
This occurs when the template HTML is empty, not just EXTRA.css. Should be easy enough to change the JavaScript that handles the response.
Template html ? I see no such template.

Or do you mean to say when extra.css is empty, because if so, mine is filled with stuff.
 

Chris D

XenForo developer
Staff member
#5
It's still possible but it requires a regular expression because otherwise it's not possible to find a simple string:

upload_2013-9-18_10-30-19.png

That works.

I'd probably say, though, that it's pretty pointless applying template modifications to EXTRA.css.

If you are going to apply template modifications to CSS then you should do so to the individual CSS templates. There's many good reasons for that.

And, of course, it's still recommended just to edit the templates directly where possible.
 

Adam Howard

Well-known member
#6
It's still possible but it requires a regular expression because otherwise it's not possible to find a simple string:

View attachment 56821

That works.

I'd probably say, though, that it's pretty pointless applying template modifications to EXTRA.css.

If you are going to apply template modifications to CSS then you should do so to the individual CSS templates. There's many good reasons for that.

And, of course, it's still recommended just to edit the templates directly where possible.
If you have 8 or more styles & you always add the same code to extra.css

Having the TMS do it for you, so you do not have to update every style individually is good thing.
 

Chris D

XenForo developer
Staff member
#7
Probably still worth modifying the several CSS templates via the TM system rather than using EXTRA.css.

But certainly with my solution above you can do it to EXTRA.css so that's there if you need it.
 

Adam Howard

Well-known member
#10
@Chris Deeming is pointing out that it's just a bug that it says that. It doesn't prevent you from saving or using a modification to that template.

The following error occurred:

Please enter a valid regular expression.

^ I also get this error when using $1 which XenForo claims is a valid expression


" You may use $0 to insert the found text. For regular expressions, you may use $1 and so on to insert sub-matches. You may use XenForo template syntax. "
 

Adam Howard

Well-known member
#15
I understood exactly what you were trying to achieve, so I gave you the exact solution for that. It works.
When I try to save that I get this.....



An exception occurred: Mysqli prepare error: MySQL server has gone away in /home/www/public_html/forums/library/Zend/Db/Statement/Mysqli.php on line 77

Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 825
Zend_Db_Adapter_Abstract->fetchOne() in XenForo/Error.php at line 55
XenForo_Error::unexpectedException() in XenForo/Application.php at line 363
XenForo_Application::handleException()


hhhmmm...... I'm going to guess hosting issue on this.....
 

Adam Howard

Well-known member
#18
When I try to save that I get this.....


An exception occurred: Mysqli prepare error: MySQL server has gone away in /home/www/public_html/forums/library/Zend/Db/Statement/Mysqli.php on line 77

Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 825
Zend_Db_Adapter_Abstract->fetchOne() in XenForo/Error.php at line 55
XenForo_Error::unexpectedException() in XenForo/Application.php at line 363
XenForo_Application::handleException()


hhhmmm...... I'm going to guess hosting issue on this.....

Not that this has anything to do with the bug report, but simply to offer a possible solution to anyone who may find this via a google search....

I was able to resolve this without changing any sever settings. The fault was my own. I had not reverted extra.css and so was trying to add everything twice (same code twice).... X was in extra.css and I was telling TMS to add X again.