RocketChat / RocketChat/Rocket.Chat
Template files aren't replaced in custom theme created
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description: Theme files aren't replaced in custom theme
I'm trying to create the custom Rocket.Chat theme to place a Rocket.Chat to the custom page layout following the official guide, the section "Adding and Modifying Templates". But Rocket.Chat continue to load original ones from app/ui/client/views
Trying to include a modules 'rocketchat:lib', 'rocketchat:theme'
api.use([
'templating',
'rocketchat:lib',
'rocketchat:theme'
]);
generates an error:
While selecting package versions:
error: unknown package: rocketchat:lib
Required by: dmitry:custom-theme 0.0.1
Steps to reproduce:
- Create and compile a local copy of Rocket.Chat server
- Do: meteor create --package dmitry:custom-theme
dmitry:custom-themeadded to .meteor/packages- package.js customized (see Additional context below)
- client.coffee file added inside package directory with content
Template.customCmsPage.replaces 'cmsPage' - File
views/customCmsPage.htmladded inside package directory (see Additional context below) - Do:
meteor add coffeescriptto avoid error ofNo plugin known to handle file 'client.coffee' - meteor npm start
- Visit http://localhost:3000/home
- Inspect the code for the additional tag appeared.
Expected behavior:
See the additional tag <p>This is a custom content</p> inside the code in the page http://localhost:3000/home
Actual behavior:
Original Rocket.Chat version of home page is loaded and no additional tag appeared.
Server Setup Information:
- Version of Rocket.Chat Server: 3.11.0-develop
- Operating System: MacOS BigSur 11.1
- Deployment Method: local compile from source
- Number of Running Instances: 1
- DB Replicaset Oplog: Enabled
- NodeJS Version: 12.18.4 - x64
- MongoDB Version: 4.2.8
Client Setup Information
- Desktop App or Browser Version: Safari
- Operating System: MacOS BigSur 11.1
Additional context
package.js content:
Package.describe({
name: 'dmitry:custom-theme',
version: '0.0.1',
summary: 'Custom Rocket.Chat theme',
});
Package.onUse(function (api) {
// api.versionsFrom('1.12');
api.use([
// 'rocketchat:lib',
// 'rocketchat:theme',
'templating',
'coffeescript',
'aldeed:template-extension',
]);
api.use('templating', 'client');
api.addFiles(['views/customCmsPage.html', 'client.coffee'], 'client');
});
views/customCmsPage.html content:
<template name="customCmsPage">
<main id="rocket-chat">
<div class="main-content cms-page">
<div class="container cms-page content-background-color">
<div class="cms-page-close">
<button class="rc-button rc-button--nude"><i class="icon-cancel"></i></button>
</div>
<div class="cms-page__content">
<p>This is a custom content</p>
{{{page}}}
</div>
</div>
</div>
</main>
</template>
Relevant logs:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the custom package.js, client.coffee, and views/customCmsPage.html, then compare them with the templates under app/ui/client/views. Run the documented meteor npm start reproduction and inspect the generated page. Done means the customCmsPage template replaces cmsPage and the additional content appears at /home.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- coffeescript, javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100