Category Archives: Plug-ins on content classes

Plug-in Show content class preassignment back reference

With this plug-in you can easily find out where a selected content class is preassigned at other containers or lists.

This plug-in shows for a selected content class all container and list elements where the selected content class is among the list of preassigned content classes.

Benefits
If you work with content class preassignment, this might be a handy tool for you to check if your preassignment are still correct and consistent with other ones.

Because the MS do not offer such a back reference out of the box, I see a need to write this scanning routine to find all lists or containers where a content class is preassigned.

If I need to change something on the preassignment I used this plug-in’s result as a working list. Copying this list of preassigned to Excel and go through the found elements one by one and correct it.

Location in SmartTree
You found the plug-in under Administer Content Classes > Folder > at every content class.

How it works
First navigate to the content class, whom preassignment you want to check. This plug-ins uses the old name Template instead of content class, because of the time it was written.

The folder and the content class is echoed back to you. Furthermore you can choose what folders you need to scan.

Use <all folders> if you are unsure. If you know, that only a specific folder needs to be scanned, you can select it from the list. This will, of course, speed up the search.

Because this scan can take several time, the plug-in keeps you informed about the progress.

After it finishes the search you get the following result table of all elements having image_block preassigned.

At the bottom you found the total number of elements found. You can use this list as a working list copying it to Excel and go through it one by one.

Installation
This plug-in can be installed using the combined setup routine for all jRQL API based plug-ins. Follow the instructions in this blog to download the installer and configure the plug-ins you want.

For API developers
The functionality is mainly backed by the following methods:

Plug-in Show language variant dependencies of content class elements

This plug-in helps you to decide, if a page of a content class will appear in the translation editor’s list of pages needing translation.  It gives an overview of the checkbox “language-variant independent” of all content elements of selected content class.

It shows a table with following columns:

  • Element name
  • Element type
  • One value for all LVs
  • Different values per LV

Please have in mind, that headline elements are treated differently from version 9.0.1.49. This attribute is moved from headline elements to the content class itself.

Benefits
The MS decides after the content class element attribute “language-variant independent” if a page of this content class will appear in the translation editor’s list of pages waiting for translation.

This is quite difficult to handle, because a typical content class has a quite big amount of elements. Checking each of them to decide if the setup is correct wastes a lot of time.

This plug-in collects this attribute’s value and present it to you for an perfect overview and checks of the translation editor setup.

Location in SmartTree
You found this plug-in under Administer Content Classes > Folder > at every content class.

How it works
First you need to navigate to the content class you want to check. Start the plug-in and immediately afterwards it will collect the needed information. The result is presented to you in the following table.

Important notice for headline elements
Don’t forget to check the state of the content class attribute “Adopt headline to all language variants”. This is introduced in V9.0.1.49. Since that version the headline elements are not included into the table.

It marks elements green, if a red dot in Smart Edit is included in the Template Variant of project’s display Project Variant. This means that the translator can access it, what is treated green = correct.

It marks elements in red, where no red dot is found. This is often wrong, because a translator will get this page for translation, but cannot access the elements needed for translation.

At the bottom the plug-in summarize the totals of all elements at all, how many of them having the same value on all language variant and how many have different values.

Installation
This plug-in can be installed using the combined setup routine for all jRQL API based plug-ins. Follow the instructions in this blog to download the installer and configure the plug-ins you want.

For API developers
The functionality is backed mainly be the following methods:

Plug-in Show content class element usage

This plug-in help you to identify unused elements in a content class for later deletion.  It gives an overview which element is used in which Template Variant source code. Unused elements are displayed as yellow rows in the matrix table.

It shows a matrix of all elements by name and type and checks every Template Variant source code of the selected content class if the element is used. An element is considered to be used, if the element value itself or the red dot for this element is used.

The  interpretation is up to the admin. Even an element is not used in any Template Variant, it cannot be deleted.

Benefits
After a while working on different content classes (or after creational work on new content classes) it is a good time for a re-factoring usually. This plug-in helped me a lot to identify unused elements, which I can delete. This keeps the number of elements as small as possible and didn’t confuses the content class developer with not needed elements anymore.

Location in SmartTree
You found the plug-in under Administer Content Classes > Folder > at every content class.

How it works
First, you need to navigate to the content class you want to investigate. Start the plug-in and it will immediately collect all content class elements and template variants and comes back to with a 2 dimensional matrix between these both.

(The title of this plug-in still uses the old name template instead of content class, because of the time of writing this plug-in this was the correct name.)

Beside element name and type you get right of column “Used?” one column for every Template Variant the selected content class have.

Each of this Template Variant columns show yes on an element row, if the element itself or it’s red dot is used, otherwise it will be blank. Blank means the element is not used!

Very important is the 3. column, because it aggregates all Template Variant column values. A no in 3. column is displayed in yellow, because these are the elements which might be deleted, because they are unsed.

Installation
This plug-in can be installed using the combined setup routine for all jRQL API based plug-ins. Follow the instructions in this blog to download the installer and configure the plug-ins you want.

For API developers
The functionality in in 3.rd column is backed by the method Template > usesTemplateElement().

The check per Template Variant is delivered by the method TemplateVariant > usesTemplateCodeElement().

Plug-in Find template elements by type and name

With this plug-in can scan all content classes of all folders searching for elements of a specific type and/or named accordingly by a given pattern. It come back to you with a table of all found content class elements with folder, content class, element name.

Benefits
This plug-in is one of my favourites, because it ensures the consistent change on all content classes by delivering a 100% list, what content classes are affected.

I use in my content classes often elements with same name and type consistently per project. If I need to change the template code around an element, I need a working list, which content classes I had to update. This plug-in provide me with exactly such kind of working list.

Location in SmartTree
You found the plug-in under Administer Content Class.

How it works
First you get a dialog where you have to choose the type of element from a drop down list. You can choose from all element types jRQL supports. Additionally you can enter a pattern (only one *) to search by element name. Of course you can enter a fix element name as well.

After clicking the button Find elements the plug-in checks all content class folders for all content classes, what can take some time. Therefore the plug-in tells you the progress this way.

If the scan is finished the elements found are presented in a tabular fashion.

The plug-in tells you how many elements found and offer a quick printing possibility. I usually copy this table to Excel and update/check each content class one by one.

Installation
This plug-in can be installed using the combined setup routine for all jRQL API based plug-ins. Follow the instruction in this blog to download the installer and configure the plug-ins you want.

For API developers
The plug-in is quite old and not based on the current functionality. Today I would start with the method to get all content classes (in API still named Template) Project > getAllTemplates().

The element searching is done by asking a Template for the elements matching the given name pattern by one of the methods Template > getTemplateElementsByType().