RM 2.2 Change 'Attach files' Button Label

Purdze

Member
Hey

I would like to change the button labal when uploading a resource. I know there is an 'Attach files' phrase however this edits all attach files buttons and I only want to update this one button, not all.

Where can I find the template which is releated to uploading within resource manager so I can add a new phrase relating to this button label

1671882691747.webp

Thanks for the help
 
The template is xfrm_category_add_resource .

View attachment 278877
Thanks Brogan , I found that but which code collerates to the button? I dont see a phrase area for it?

Code:
<xf:title>{{ phrase('xfrm_add_resource') }}</xf:title>

<xf:breadcrumb source="$category.getBreadcrumbs()" />

<xf:form action="{{ link('resources/categories/add', $category) }}" upload="true" ajax="true" class="block"
    draft="{{ link('resources/categories/draft', $category) }}"
>
    <div class="block-container">
        <div class="block-body">
            <xf:macro template="xfrm_resource_edit_macros" name="title"
                arg-resource="{$resource}"
                arg-prefixes="{$prefixes}" />

            <xf:macro template="xfrm_resource_edit_macros" name="tag_line" arg-resource="{$resource}" />

            <xf:macro template="xfrm_resource_edit_macros" name="type"
                arg-currentType="{{ $category.draft_resource.resource_type ?: $category.getDefaultSelectedType() }}"
                arg-resource="{$resource}"
                arg-category="{$category}"
                arg-versionAttachData="{$versionAttachData}" />

            <xf:if is="$category.hasVersioningSupport()">
                <xf:textboxrow name="version_string" value="{$category.draft_resource.version_string}"
                    label="{{ phrase('xfrm_version_number') }}" />
            </xf:if>

            <xf:if contentcheck="true">
                <hr class="formRowSep" />

                <xf:contentcheck>
                    <xf:macro template="custom_fields_macros" name="custom_fields_edit"
                        arg-type="resources"
                        arg-set="{$resource.custom_fields}"
                        arg-group="above_info"
                        arg-editMode="{{ $resource.getFieldEditMode() }}"
                        arg-onlyInclude="{$category.field_cache}" />
                </xf:contentcheck>
            </xf:if>

            <hr class="formRowSep" />

            <xf:macro template="xfrm_resource_edit_macros" name="description"
                arg-description="{$category.draft_resource.message}"
                arg-attachmentData="{$attachmentData}"
                arg-previewUrl="{{ link('resources/categories/preview', $category) }}" />

            <xf:if is="$category.canEditTags()">
                <xf:tokeninputrow name="tags" value="{$category.draft_resource.tags}"
                    href="{{ link('misc/tag-auto-complete') }}"
                    min-length="{$xf.options.tagLength.min}"
                    max-length="{$xf.options.tagLength.max}"
                    max-tokens="{$xf.options.maxContentTags}"
                    label="{{ phrase('tags') }}">

                    <xf:explain>
                        {{ phrase('multiple_tags_may_be_separated_by_commas') }}
                        <xf:if is="$category.min_tags">
                            {{ phrase('this_content_must_have_at_least_x_tags', {'min': $category.min_tags}) }}
                        </xf:if>
                    </xf:explain>
                </xf:tokeninputrow>
            </xf:if>

            <xf:if contentcheck="true">
                <hr class="formRowSep" />

                <xf:contentcheck>
                    <xf:macro template="custom_fields_macros" name="custom_fields_edit_groups"
                        arg-type="resources"
                        arg-set="{$resource.custom_fields}"
                        arg-groups="{{ ['below_info', 'extra_tab', 'new_tab'] }}"
                        arg-editMode="{{ $resource.getFieldEditMode() }}"
                        arg-onlyInclude="{$category.field_cache}" />
                </xf:contentcheck>
            </xf:if>

            <hr class="formRowSep" />

            <xf:macro template="xfrm_resource_edit_macros" name="external_url" arg-resource="{$resource}" />
            <xf:macro template="xfrm_resource_edit_macros" name="alt_support_url" arg-resource="{$resource}" />

            <xf:if contentcheck="true">
                <hr class="formRowSep" />

                <xf:contentcheck>
                    <xf:macro template="xfrm_resource_edit_macros" name="resource_icon" arg-resource="{$resource}" />
                </xf:contentcheck>
            </xf:if>
        </div>
        <xf:submitrow icon="save" sticky="true" />
    </div>
</xf:form>
 
It's probably in an associated (macro) template.

Do a template search for the phrase attach_files - that should produce a list of templates which use it.
 
This is the relevant block of code in the xfrm_resource_edit_macros template:

1671899909347.png

It looks like you need to be looking in the helper_attach_upload template.

This is most likely a common template so you may need to get creative to change the text for one place only.
 
This is the relevant block of code in the xfrm_resource_edit_macros template:

View attachment 278881

It looks like you need to be looking in the helper_attach_upload template.

This is most likely a common template so you may need to get creative to change the text for one place only.
Ok so turns out the actual phrase is in helper_js_global.
Code:
attach: "{{ phrase('button.attach')|escape('js') }}",
.

I think this will be a case of commissioning someone to do this...

As usual, thanks for the help Brogan!

PS. Could you check out this question to ;) https://xenforo.com/community/threads/changing-title-in-your-account.211207/#post-1605887

Thanks! Merry Christmas
 
Top Bottom