Resource icon

Template Modification System (TMS) 1.3.1

No permission to download
I have noticed that if you were to make a syntax error in the TMS, you receive no helpful error message like you would if you were editing a template directly. Perfect example is if you put in a <xen:if statement without a </xen:if closing it.

At this point if you click Save and Check you get "No differences found". This now tells me that something has gone wrong. But if I'm not thinking and click Save and Exit, I get no error and I'm left with "Applied 0". Then, going back into the modification reveals that the modification has now reverted back to what it was before I made the syntax error. If I had made other changes along with the syntax error then these would be lost too.

It would be ideal if an error were to pop up, like the default template editor, if a syntax error is detected.

Also, I'll look through the previous pages in this thread but is there any guides on how to do preg replace queries.

If I want to change, for example, the "Create Thread" button in the forum_view, this appears twice in that template. I imagine with preg_replace I can do it in one modification rather than creating two modifications using simple search and replace?
 
The errors are listed in the Server Error Log.
It does'n throw error when syntax is incorrect since one template can have more than one modification. Moreover, these modifications can be itself valid but using them together makes template not valid. The thing can be done for it is adding the reason of 'Applied 0 times' like 'Error occured' or 'Disabled'.
 
The errors are listed in the Server Error Log.
It does'n throw error when syntax is incorrect since one template can have more than one modification. Moreover, these modifications can be itself valid but using them together makes template not valid. The thing can be done for it is adding the reason of 'Applied 0 times' like 'Error occured' or 'Disabled'.
Ok, makes sense I guess.

I will keep an eye on the Server Error Logs now. I just have to be careful to do Save and Check instead of Save and Exit because at least if I see "No Differences" I know that I've done something wrong and I can fix it before I click Save and Exit and lose my changes.
 
Sorry if this is a noob question, but I just purchased XenForo and installed TMS to make my own style.
If I understand correctly TMS allows you to replace templates and css files without actually replacing them.
But what if I just want to add a few CSS classes and not replace anything? The Options TMS gives me are

1) String Replace
2) Preg Replace
3) PHP Callback

I don't think any of these are suitable for just adding CSS classes, no? If I leave the Search field blank and just put my CSS classes in the Replace field, I get an error saying that I don't have a valid search string. So how can this tool help me adding stuff instead of replacing stuff?
 
Sorry if this is a noob question, but I just purchased XenForo and installed TMS to make my own style.
If I understand correctly TMS allows you to replace templates and css files without actually replacing them.
But what if I just want to add a few CSS classes and not replace anything? The Options TMS gives me are

1) String Replace
2) Preg Replace
3) PHP Callback

I don't think any of these are suitable for just adding CSS classes, no? If I leave the Search field blank and just put my CSS classes in the Replace field, I get an error saying that I don't have a valid search string. So how can this tool help me adding stuff instead of replacing stuff?
You can use Preg Replace with Search
Code:
#^.*$#s
The replace will be
Code:
$0
/*your added code*/
 
I have a problem.

If I create a template edit for the navigation.css file, TMS will actually replace that template. After that it will say that 0 differences found. Is this a known bug? I am unable to edit my navigation.css through TMS, because it's same as going to Templates section and modifying it from there. It works for other files, but oddly not for navigation.css.

I tested the same with header.css and it works just fine. Seems like the problem exists only when editing navigation.css. Add-ons that I currently have installed are: Add User Avatar to Last Port by Waindigo, AzuCloud, Custom BBCode Manager, Find users sharing the same IP, Nodes As Tabs, TaigaChat, Template Modification System, XenPorta, Tag Me.
 
I have a problem.

If I create a template edit for the navigation.css file, TMS will actually replace that template. After that it will say that 0 differences found. Is this a known bug? I am unable to edit my navigation.css through TMS, because it's same as going to Templates section and modifying it from there. It works for other files, but oddly not for navigation.css.

I tested the same with header.css and it works just fine. Seems like the problem exists only when editing navigation.css. Add-ons that I currently have installed are: Add User Avatar to Last Port by Waindigo, AzuCloud, Custom BBCode Manager, Find users sharing the same IP, Nodes As Tabs, TaigaChat, Template Modification System, XenPorta, Tag Me.
What are your search and replace values?
 
What are your search and replace values?
My search value is:
Code:
    .navTabs
    {
        @property "navTabs";
        font-size: 11px;
        background-color: @primaryDark;
        padding: 0 25px;
        border: 1px solid @primaryLightish;
        border-bottom: 1px solid @primaryDarker;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
        @property "/navTabs";
     
        height: @headerTabHeight;
    }

My replace value is:
Code:
    .navTabs
    {
        @property "navTabs";
        font-size: 11px;
        background-color: @primaryDark;
        padding: 0 25px;
        border: 1px solid @primaryLightish;
        border-bottom: 1px solid @primaryDarker;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
/*Testing with comment if this one passes to the actual template*/
        @property "/navTabs";
     
        height: @headerTabHeight;
    }

After saving, something changes the search value to my replace value, and this is my navigation.css viewed from the XenForo default Templates section:
Code:
#navigation .pageContent
{
    height: {xen:calc '@headerTabHeight * 2 + 2'}px;
    position: relative;
}
 
    .navTabs
    {
        @property "navTabs";
        font-size: 11px;
        background-color: @primaryDark;
        padding: 0 25px;
        border: 1px solid @primaryLightish;
        border-bottom: 1px solid @primaryDarker;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
/*Testing with comment if this one passes to the actual template*/
        @property "/navTabs";
     
        height: @headerTabHeight;
    }
 
        .navTabs .publicTabs
        {
            float: left;
        }
     
        .navTabs .visitorTabs
        {
            float: right;
        }
 
            .navTabs .navTab
            {
                float: left;
                white-space: nowrap;
                word-wrap: normal;
             
                <xen:if is="{$pageIsRtl}">*display: inline; *float: none; *zoom: 1;</xen:if>
            }
 
--Omitted, because unable to post a post larger than 10000 characters.---
I am not getting any erros in the Server log either. Strange.
 
That's not a bug it's style property system. I will explane how it works:
What you see in editor is not exact template. If you look at the db you will see:
Code:
    .navTabs
    {
        {xen:property navTabs}
 
        height: {xen:property headerTabHeight};
    }
The editor substitutes the current value of proprty 'navTabs' and show it to you. As the result you see
Code:
    .navTabs
    {
        @property "navTabs";
        ...
        /*property value*/
        ...
        @property "/navTabs";
 
        height: @headerTabHeight;
    }
And when you save template or modification engine will reads the chunk
Code:
        @property "navTabs";
        ...
        /*property value*/
        ...
        @property "/navTabs";
    }
and rewrites the current value of property navTabs.
That's why when you open modification next time you see new substituted value of property navTabs.

To avoid such behaviour just put change outside of property chunk:
Code:
    .navTabs
    {
        @property "navTabs";
        font-size: 11px;
        background-color: @primaryDark;
        padding: 0 25px;
        border: 1px solid @primaryLightish;
        border-bottom: 1px solid @primaryDarker;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
 
        @property "/navTabs";
        /*Testing with comment if this one passes to the actual template*/
        height: @headerTabHeight;
    }
 
How is testing? Any suggestions, reports?
Here's a suggestion. Can you add a feature that will let you wrap a template in a conditional using check boxes? For example, when creating a TMS modification and loading a template, could we have a section with checkboxes that have the extra conditionals we'd like to apply to the template? This was a previous suggestion I made last year: http://xenforo.com/community/threads/template-conditionals-checkbox-for-each-template.22987/
 
Here's a suggestion. Can you add a feature that will let you wrap a template in a conditional using check boxes? For example, when creating a TMS modification and loading a template, could we have a section with checkboxes that have the extra conditionals we'd like to apply to the template? This was a previous suggestion I made last year: http://xenforo.com/community/threads/template-conditionals-checkbox-for-each-template.22987/
It seems that such feature already exists. All disabled modes stay disabled after upgrade and export.
 
If I install this, will it mess up any current template modifications I have made or conflict with any current add ons?
 
Just go to install addon, select file and hit install ?
Will that import it correctly to the destination addon adding that language to it ?

Thanks.
Import localization as language, not as addon.
I think there were a few add ons that I installed that had an option for TMS but I didn't do them because I wasn't using this. Do I have to reinstall those?
If you made changes to templates before you have to remove them (revert templates if no other edits) and reinstall those addons with enabled TMS.
 
Top Bottom