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

MG 1.1 After upgrading my custom template modification is gone!

imthebest

Formerly Super120
#1
When I was on MG 1.1.0 I created a template modification in the template "member_card" (additional to the 2 that come as stock). I have just upgraded to 1.1.1 and noticed that my template modification is gone! IIRC, during an upgrade the system will overwrite the stock template modifications of the add-on however I'm not sure if it is also normal to have those extra template modifications deleted.
 
Last edited:

CyclingTribe

Well-known member
#2
I would have expected it to warn you and give you the option to merge the changes (assuming the gallery templates are treated the same way as the core forum templates?).
 

CyclingTribe

Well-known member
#4
Ooops, sorry, I misunderstood ... I took 'template modification' to mean you'd edited a template - completely forgetting about the actual template modification system. :oops: :)
 

Brogan

XenForo moderator
Staff member
#5
Any template modifications you create should be linked to your own custom add-on, not the existing add-on.

Otherwise they will be removed when upgrading.
 

Mike

XenForo developer
Staff member
#6
You tagged your template modification as being part of the add-on. It is totally expected that it is removed when you upgraded the add-on. You can't modify parts of an add-on and expect it to persist an upgrade to the add-on. There's a very good reason why you can only do this in debug mode.

If you really want to do this via a template modification, don't apply it to an add-on (or create your own add-on to contain your changes).
 

imthebest

Formerly Super120
#8
If you really want to do this via a template modification, don't apply it to an add-on (or create your own add-on to contain your changes).
Since I don't know how to create add-ons, I'm currently deciding between these two places at admin.php?template-modifications/add:

Add-on: (blank)
Add-on: XenForo

I guess that if I choose XenForo then my custom template modification is also going to get lost after I upgrade XenForo, right? So at the end I should leave the "Add-on" field untouched (i.e. blank), right?
 

Chris D

XenForo developer
Staff member
#9
I guess that if I choose XenForo then my custom template modification is also going to get lost after I upgrade XenForo, right? So at the end I should leave the "Add-on" field untouched (i.e. blank), right?
Right. But, seriously, just edit the template directly. With the frequency we actually change the member card template I can't even envisage you'd ever be in a situation where it becomes outdated.
 

imthebest

Formerly Super120
#10
Well, here is my problem.

On XenForo, at the template member_card I have changed the following (on the template itself, no template modifications here):

Find:
Code:
<a href="{xen:link members, $user}">{xen:phrase profile_page}</a>
Replace with:
Code:
<a href="{xen:link search/member, '', 'user_id={$user.user_id}', 'content=thread'}" rel="nofollow">Threads</a>

Since the Media Gallery have a template modification against member_card with the following config:

Find:
Code:
<a href="{xen:link members, $user}">{xen:phrase profile_page}</a>
Replace with:
Code:
$0
<xen:include template="xengallery_member_card_links" />

I need it to look for my custom:
Code:
<a href="{xen:link search/member, '', 'user_id={$user.user_id}', 'content=thread'}" rel="nofollow">Threads</a>
Instead of the stock:
Code:
<a href="{xen:link members, $user}">{xen:phrase profile_page}</a>

This is why I need to use a template modification. And I need to use a custom one because if I edit your own then with every MG upgrade I'll lose the changes.

Is there an easier way to achieve what I'm looking for?
 
Last edited: