wiki:Webdev

Version 34 (modified by Sander Maijers, 8 years ago) (diff)

contents: add subtheme steps

We use the Drupal Content Management System (CMS) for https://www.clarin.eu. A general, brief overview of Drupal.

https://www.clarin.eu/admin/reports/status

https://www.clarin.eu/admin/reports/dblog

https://www.clarin.eu/admin/config/development/maintenance

1.1. Working documents

https://www.dropbox.com/s/f49ptirgjlma2n5/CLARIN-EU-4-menu-items-structure%2020160601.xlsx?dl=0

https://office.clarin.eu/v/CE-2016-0792-Website_requirement_specification.docx

2. Development workflow

Development follows a three-stage workflow:

  1. development: dev-www.clarin.eu?
  2. acceptance
  3. production: Archive/www.clarin.eu

Drupal should be managed from the command line with Drush. Commands for drush.

3. Tickets

Results (1 - 5 of 23)

1 2 3 4 5
Ticket Priority Summary Owner Keywords Created Modified
#907 minor support multi-file upload again André Moreira 8 years ago 6 years ago
#938 major Replace clarin_datatable custom code by standard feeds module Dieter Van Uytvanck 8 years ago 6 years ago
#958 minor Files missing Dieter Van Uytvanck 8 years ago 6 years ago
#965 minor Clean up Drupal redirects Dieter Van Uytvanck 8 years ago 6 years ago
#967 major User involvement group pages on new website Dieter Van Uytvanck 8 years ago 6 years ago
1 2 3 4 5

1. Conversion from legacy state to basic Drupal

This should be organized in the following stages.

1.1. Enable Bootstrap module

## Enable Bootstrap
drush.phar pm-enable 'jquery_update' 'bootstrap'

## The frontpage view was disabled in the legacy state, reenable it.
drush.phar views-enable 'frontpage'
  1. ‘Sub Seven’ admin theme -> ‘Default theme’.
  2. Set Bootstrap theme as default.
  3. Disable ‘Clarin.eu Theme’.
  4. ‘Source for the Secondary links’: User menu -> Secondary menu.
  5. Disable block ‘Main menu’ by setting it to `- None -` in the dropdown in ‘Region settings’.
  6. -> Set ‘Default front page’ to 'frontpage'.
  7. Use relative ‘Login’ link: Path * (URL)/user -> user

1.2. Disable legacy/redundant extensions

## Must be updated to dev version first, since otherwise it won't uninstall due to bugs.
drush.phar pm-enable 'empty_page-7.x-1.x-dev'
## IMPORTANT: Quit endless loop here!

## Alpha.
drush.phar pm-disable 'uuid_features'

## ‘Minimally maintained’.
drush.phar pm-disable 'smart_trim'

## 7.x-3.0-rc5.
drush.phar pm-disable 'admin_menu' 'admin_menu_toolbar'

## Apparently not in use.
drush.phar pm-disable 'entityreference_prepopulate' 'fences' 'colorbox'

## Seems unused, only used for twitter_pull_bean?
drush.phar pm-disable 'bean_admin_ui' 'bean' 'bean_entitycache' 'bean_uuid'

## Functionality seems unrequired.
drush.phar pm-disable 'imagecache_actions' 'imagecache_canvasactions' 'empty_page' 'timeago'

## Superfluous functionality and/or security risk.
drush.phar pm-disable 'backup_migrate' 'environment_indicator'  'admin_devel'

## The following modules could be directly traced to Jurriaan. They have cyclic dependencies and define a number of features and views.
drush.phar pm-disable 'menu_block' 'bean_twitter_pull' 'twitter_pull' 'openscience_blog' 'openscience_events' 'openscience_groups' \
                      'context' 'context_ui' 'context_menu_block' 'context_og' 'clarin_eric_config' 'clarineric' 'clarin_eric_config' \
                      'openscience_news' 'openscience_showcases' 'lrt_showcases' 'openscience_ui' 'openscience' 'openscience_governance' \
                      

## Make sure that the remaining extensions are up-to-date.
drush.phar pm-update --no-backup

Remove residual Drupal views by visiting:

  1. https://dev-www-3.clarin.eu/admin/structure/views/view/openscience_events/delete
  2. https://dev-www-3.clarin.eu/admin/structure/views/view/openscience_group_river/delete
  3. https://dev-www-3.clarin.eu/admin/structure/views/view/openscience_movies/delete
  4. https://dev-www-3.clarin.eu/admin/structure/views/view/openscience_popular_content/delete
  5. https://dev-www-3.clarin.eu/admin/structure/views/view/featured_lrt_showcase/delete
  6. https://dev-www-3.clarin.eu/admin/structure/views/view/featured_showcase/delete
  7. https://dev-www-3.clarin.eu/admin/structure/views/view/lrtshowcases/delete

1.3. Enhance functionality before testing

Some Website Trac tickets (at the top of this page) are feature requests/enhancements. Ideally these can be added without much risk and then included in the acceptance tests.

https://trac.clarin.eu/ticket/938

drush.phar cache-clear 'all'

## Enable CKEditor for rich text edition (WYSIWYG).
drush.phar pm-disable 'WYSIWYG'
drush.phar pm-enable 'ckeditor'

## Enable smtp module so that Centre registration form, which depends on e-mail functionality, works.
drush.phar pm-enable 'smtp'
  1. -> Disable Drupal queue

1.4. Content restructuring

The office restructures content so that excess hierarchy is flattened. Tasks

  1. Find in page contents (HTML) improper absolute links (e.g. http://www.clarin.eu/content/...) and replace them with relative links (/content/...).
  2. TODO: ...

1.5. Acceptance tests

  1. Adding a basic page.
  2. Uploading multiple files in one go.
  3. Writing a blog post.
  4. Filling out the Centre Registry form.
  5. TODO: ...

1.5.1. Criteria

Does the rich text editing work as expected?

1.6. Theming

We apply a Drupal Bootstrap subtheme to dev-www designed after the new CLARIN house style, named ‘CLARIN Horizon’.

curl -LSs 'https://github.com/drupalprojects/bootstrap/archive/7.x-3.5.tar.gz' | tar -x -z -p -v -f -
## Use the Less-based starter kit.
cp -apr 'bootstrap-7.x-3.5/starterkits/less' 'CLARIN_Horizon/'
cd 'CLARIN_Horizon/'
mv 'less.subtheme' 'CLARIN_Horizon.info'
## Edit subtheme properties
nano 'CLARIN_Horizon.info'

git clone 'git@github.com:twbs/bootstrap.git'
cd 'bootstrap/'
git fetch --tags
git checkout 'v3.3.6'
cd -

## Install Less and NodeJS, e.g. with `sudo pacman -Syu nodejs-less-2.7.1-1`
npm install -g 'clean-css'

## Transpile.
lessc --clean-css 'less/style.less' > 'css/style.css'

# On dev-www host
sudo docker cp 'CLARIN_Horizon.tar.gz' 'clarinericwebsitedev3_httpd_1:/var/www/localhost/htdocs/sites/all/theme/'

# sh into clarinericwebsitedev3_httpd_1 as root, then ...
tar -f 'CLARIN_Horizon.tar.gz' -x -v -z
chown -Rc '0:www-data' 'CLARIN_Horizon/'
  1. -> Enable CLARIN_Horizon
  2. CKeditor: stop filtering content.
    1. safe_html -> table[width|cellspacing|class].
    2. ‘Rules for Class Names’ -> table.
    3. ‘Rules for URLs used within inline styles’ -> /*. (???)

1.7. Acceptance tests

1.8. Conversion of www.clarin.eu

Based on the final, validated steps, we set www.clarin.eu as read-only for a regular maintenance, and apply the steps to the www.clarin.eu instance.

1.9. Thorough cleanup of dev-www, then www

## Jurriaan's modules all have cyclic dependencies, so cannot be uninstalled.
## IMPORTANT: The following command
drush.phar pm-uninstall $(drush.phar pm-list --status='disabled' --format=list --no-core)
## May cause Drush defects reported as:
## Error: require_once(): Failed opening required '/var/www/localhost/htdocs/sites/all/modules/contrib/menu_block/plugins/content_types/menu_tree/menu_tree.inc'
## (include_path='.:/usr/share/pear') in /var/www/localhost/htdocs/sites/all/modules/contrib/ctools/includes/plugins.inc, line 477

## Uninstalling extensions using Drush does not result in actual removal.
## To forcefully remove ‘disabled, uninstalled’ modules/themes.
drush.phar pm-list --status='disabled,not installed' --no-core --pipe | \
    xargs -n 1 -I '{}' drush.phar drupal-directory --local-only --component='path' '{}' | \
        xargs -n 1 -I '{}' rm -frv -- '{}'

## Clean up informal dependencies, e.g. in 'sites/all/libraries/'
# rm -r 'sites/all/libraries/timeago/'

drush.phar cache-clear all

## Remove security sensitive and redundant files from Drupal installation.
rm 'install.php' 'CHANGELOG.txt' 'INSTALL.txt' 'INSTALL.mysql.txt' \
        'INSTALL.pgsql.txt' 'LICENSE.txt' 'MAINTAINERS.txt' 'UPGRADE.txt' \
        'COPYRIGHT.txt' 'README.txt' 'INSTALL.sqlite.txt'

## Remove residual Drupal Blocks.
## See: https://dev-www-3.clarin.eu/admin/structure/block-types

## TODO: Remove residual Drupal Features. Cannot be done with Drush or the Drupal web interface alone.
...

## Remove LRT Showcase content type: if adding a content node, this content type is picked.

1.10. Acceptance test

(details to be added)

  • working frontpage
  • event list
  • news + blog list
  • contact page
  • views/static pages for: committees (governance), showcases, featured resources
  • intranet pages (drupal groups) reachable and usable
  • redirect /user/register to CLARIN IdP

1.11. Finishing touch

1.11.1. Enhancement: do not use CDN.

IMPORTANT: breaks the website without alternative source other than CDN. Make independent from `jsdeliver`: -> Advanced

1.11.2. Clean up content types

Not necessary: Merge nodes of LRT Showcase type with Showcase type.

Although these node have a similar (technical/internal) name (due to a misconception earlier on), they are fundamentally different: the showcases are more elaborate descriptions of how a CLARIN tool or resource can be used to answer a specific question. The featured resources (LRT Showcase) are simple examples of resources/tools. Many of them have a searchbox included. They should not be merged.

Attachments (1)

Download all attachments as: .zip