Resource icon

Template Modification System (TMS) 1.3.1

No permission to download
sorry, but again me with some requests:D

the biggest problem for me, are the admin template changes, because of the missing hooks there......
would be great if we could also modify them:)
 
it is working .. but I never was able to get original template text to appear via autocomplete

I now see where I can use this to best advantage... particularly PAGE_CONTAINER template

thank you for this addon
Check that you put js/tms from archive in the js of the engine. And what browser you use?
sorry, but again me with some requests:D

the biggest problem for me, are the admin template changes, because of the missing hooks there
would be great if we could also modify them:)
For admin templates I always use template_post_render event to apply replacements. Admin templates don't need any performance. Also there is some risk to break admin template in the case of incompability with future versions.
 
[ot]
For admin templates I always use template_post_render event to apply replacements. Admin templates don't need any performance. Also there is some risk to break admin template in the case of incompability with future versions.

sorry for offtopic, but how would you use it to add to every addon dropdown menu own links
foobar.webp

Fist 1 edited the template direct, but because of the strange xf admin template behaviour, or changes were overwriten without asking if i want to revert them:(

as next i created a own template and changed the controller output to my new template (which is also not optimal, because i need to check on every upgrade, if the original template was changed)

and now i'm using some strange javascript code to add them, but it's IMO also not optimal and very hard for me:(
 
[ot]

sorry for offtopic, but how would you use it to add to every addon dropdown menu own links
View attachment 27284

Fist 1 edited the template direct, but because of the strange xf admin template behaviour, or changes were overwriten without asking if i want to revert them:(

as next i created a own template and changed the controller output to my new template (which is also not optimal, because i need to check on every upgrade, if the original template was changed)

and now i'm using some strange javascript code to add them, but it's IMO also not optimal and very hard for me:(
Maybe use preg_replace in template_post_render.
Something like this:
PHP:
$content = preg_replace('#(<li>.*?<a href="admin.php?add-ons/.*?/)(export)(">)Export(</a>.*?</li>)#s', '$0$1create-zip$2'.new XenForo_Phrase('create_zip').'$3', $content)
Seems poor, but ok for ACP :) And admin template stay in safety.
 
Hmmmm, is there any known issue with using XenForo functions in the replacement string, such as <xen:include template="my_new_template" /> ?
The original string I search for is there, but TMS doesn't replace it (0 replaced red box).
 
Hmmmm, is there any known issue with using XenForo functions in the replacement string, such as <xen:include template="my_new_template" /> ?
The original string I search for is there, but TMS doesn't replace it (0 replaced red box).
It should work if the final modified template is valid.
First try very-very simple modification like.
find
Code:
<xen:include template="my_new_template" />
and replace
Code:
replaced
 
It should work if the final modified template is valid.
First try very-very simple modification like.
find
Code:
<xen:include template="my_new_template" />
and replace
Code:
replaced
I'm trying to add the template include as a replacement for another part of a template. ;)
I'm already using TMS for multiple addons and manual entries, but for some reason I can't get this particulate one to work. :/

Find in message_user_info:
Code:
<em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em>

Replace with:
Code:
<xen:include template="message_user_badges" />
 
Addon first does all modifications to the template, then tries to compile final template. If modified template is not valid it ignores all modifications and compiles original template.
You may just copy search and replace string here, I will check it out.
 
Addon first does all modifications to the template, then tries to compile final template. If modified template is not valid it ignores all modifications and compiles original template.
You may just copy search and replace string here, I will check it out.
Well, the template I created is there and so is the original string. The template I am trying to modify hasn't been modified by any other addons or TMS edits.
What I am trying to do is in my previous post.
 
It's not valid. You can't remove xen:contentcheck from there. That happens if I try to edit this manually.
Screenshot_21.webp
 
It's not valid. You can't remove xen:contentcheck from there. That happens if I try to edit this manually.
View attachment 27483
I'm not removing the first content check, I am removing the second that is no longer needed. This is coming from my manual edit that worked fine for months, I'm just trying to convert it to TMS. If I manually edit the template, it works fine. The TMS edit however does not.

Edit: Haha, you are right actually... I see what you are saying now. I removed the actual content check inside the first part. My manual edit had it, but I forgot it with the other.

Thanks for clarifying my stupidity. :P
 
There is a condition <xen:if hascontent="true"> so there must be a content check inside of it.
Try this search string:
Code:
<xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em></xen:if>
And same replace string:
Code:
<xen:include template="message_user_badges" />
 
There is a condition <xen:if hascontent="true"> so there must be a content check inside of it.
Try this search string:
Code:
<xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em></xen:if>
And same replace string:
Code:
<xen:include template="message_user_badges" />
I already got it working. ;)
I saw what you were saying after I looked at it again. I simply added the contentcheck back into my replacement as I removed it by mistake when moving from the manual edit.

Thanks for the help. :)
 
Could you implement a diff button in templates list page, so people can easily import their change to template modifications?
 
Top Bottom