Code Monkey home page Code Monkey logo

oppna-program-reklistan-theme's Introduction

oppna-program-reklistan-theme

This is a WIP readme.

This theme is used by reklistan.vgregion.se. However, it's a little bit more than your average theme. The site is a "headless website", meaning that Liferay serves all data as JSON and the actual rendering is done client side.

Currently "JSON" is served by placing a few Asset Publishers on the page, set to display the entries with an ADT which outputs <script>var data = { ... }</script>. This will be changed to be fetched from an actual portlet (which outputs JSON).

Permissions

Add access to Site administration

Every user who's going to be logged in assigned workflow tasks needs to get access to the Site Administration. Enable that by:

  1. Go to Control Panel > Users > Roles.
  2. On User click Actions > Define Permissions.
  3. Expand Site Administration > Content > Web Content.
  4. Tick Access in Site Administration
  5. Save

Building

Javascript

The Javascript files in /lib and /custom-lib are all minified and merged into /js/libs.min.js. This is done with a gulp script.

First time - install build dependencies. Make sure you have node.js installed (run node -v to get version number), then run:

cd core-bc/modules/theme/src/main/webapp
npm install

To rebuild the libs.min.js from the source files:

cd core-bc/modules/theme/src/main/webapp
gulp buildjs

Settings

For now, the settings are hardcoded in the js/main.js file.

properties: {
	companyId: 11111
	groupName: 'Guest',
	drugsStructureId: 22222
	adviceStructureId: 33333
	resourcesStructureId: 44444
}

The structure IDs you get by navigating to the control panel > content > articles > structures.

To get the companyId and groupName, go to a page on the public front end of the site which has the default theme (as oposed to the REK-theme). All environments should have a /admin page set up.

To get the companyId, open your browser console and run

themeDisplay.getCompanyId()

The groupName you'll get by running:

Liferay.Service(
  '/group/get-group',
  {
    groupId: Liferay.ThemeDisplay.getSiteGroupId()
  },
  function(obj) {
    console.log(obj.name);
  }
);

oppna-program-reklistan-theme's People

Contributors

patrikbjork avatar

Watchers

 avatar Andreas Magnusson avatar James Cloos avatar VGR developers avatar  avatar Hans Gyllensten avatar  avatar  avatar  avatar  avatar

Forkers

patrikbjork

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.