Local assets allows web designers and web developers to customize the look and feel of their site. Setting the local assets property on the site configuration tab calls additional files on every HTML page. By changing the contents of these files, web designers have access to change how content is displayed. The two files referenced in the HTML <head> (that will be added when the local assets url field is filled) are:
[local assets url]/modifyGlobalTemplate.css
[local assets url]/modifyGlobalJS.js
An additional file is loaded as the last item in the body:
[local assets url]/modifyGlobalJS_body.js
Stash / Bitbucket Configuration
Requesting local assets
Please request local assets by Clicking on “Help” > “Request Support” in the CMS. In the form, please indicate that you would like local assets and also the site URL.
Setting up local assets
Once created, local assets are managed in a git repository in a Stash / Bitbucket server. People that have access to the repository will need be members of the group cms.[siteurl].web_designer. Web-admins can add members to this group using http://webapps.es.vt.edu/group-manager.
- Go to https://author.ensemble.vt.edu/mysites.html
- Check the box to the left of your website and "View Properties"
- Click "Edit"
- Choose "Site Configuration"
- Enter a Local Assets Path: /local_assets/[site_url]
(replace [siteurl] with the url of your site. For example, www.mysite.vt.edu and note that the www. at the beginning of the site name is required to match the site name in the git repository.)
- Publish out the site root (/)
- Publish out the index (/en/index)
Work process for local assets
A web designer for the site has full permissions to their local assets repo (so they can delete the pprd and prod branches, but doing so will break the hooks in place that update assets on the respective environments)
Login to Stash / BitBucket with your pid / password: https://webapps.es.vt.edu/stash/projects/CMSASSETS/repos/[siteurl]
(replace [siteurl] with the url of your site. For example, www.assets.cms.vt.edu)
If this is the first time logging in, you may get an message saying that you do not have access to any repos. If this is the case, wait before trying to login again. The first login creates an account on the repository and there is a sync process that runs every half hour to update group memberships).
If you still have problems accessing your local assets repository, please send us a Help Ticket: in the CMS click on “Help” > “Request Support”).
Clone Repo. The clone URL is available under "Clone" in the "Actions" menu entry. You may need to click on the elipses (...) to see this menu entry.
You can use a git client like SourceTree (https://www.sourcetreeapp.com/). Once SourceTree is installed, you can click on the "Clone in SourceTree" after selecting the "Clone" entry and this should open up the application with the correct clone parameters.
Make local commits to individual branches (if wanted) and push when necessary to origin/master.
Commits to master automatically update the DVLP environment (our development server for AEM Ensemble websites).
Create a pull request from master to pprd and merge to pprd.
The action of merging to pprd will update the assets in PPRD (our preproduction/test version of AEM Ensemble websites).
Verify changes in PPRD: https://cmsa-pprd-01.db.vt.edu/
Create a pull request from pprd to prod and then merge to prod.
The action of merging to prod will update the assets in PROD (the live versions of our AEM websites).
Creating and managing Pull Requests via a browser
Login to Stash / Bitbucket with your pid / password: https://webapps.es.vt.edu/stash/projects/CMSASSETS and click on your site url.
Click on “Create pull request” from the left side menu
If you do not see this menu, type [ on your keyboard which should expand out the left menu
You can also click on the the Pull Request Icon, then click on “Create Pull Request”
The arrow indicates which branch is pull request is coming from and going to (The top is the originating branch and the bottom is the branch that the pull request will be merged into.
Select the desired branches (ie. master -> pprd)
You can review the changes by clicking on the “Diff” tab. You can also add additional reviewers at this step.
Click on “Create” to create the pull request.
Once the pull request has been created, you can approve it and “Merge” it.
Click on the “Diff” to see the changes in the pull request
Click on “Merge” to approve the pull request and merge it.
If the automatic merge fails, this means that there is a conflict in the file which cannot be resolved automatically.
Download the repo in your computer using a git client
Check out the branch that is being merged into
Pull from the origin branch that the pull request is coming from
Push the branch to the origin
Yes, currently you can add your own server in the local assets url and as long as you have the correct names of the files, it should work. This can be great for rapid testing of code pre-launch. However, this technique is not supported and may not be available in the future. You may also run into cross-site scripting issues hosting your own local asset links.
We recommend using the Stash / Bitbucket configuration because of all the benefits of a git repository (revisions) as well as control over access (via the web_designer group).