Display and editing complex data

I am looking for suggestion how to display complex data for reading/editing.

Data will be key-value, example:

string-val: “v12”,
int-value: 99,
boolean: true

I these types I think simple table will do the trick (with editable rows).

I will also have to support the following:
array-val: (1, 2 ,3), object-value: {name: “bp”, amount: 4}, array-object-value: ({name: “bp”, amount: 4}, {name: “bp”, amount: 4})

I am considering using: https://material-ui.com/components/tables/#collapsible-table (just an example because we use material-ui), where the dropdown V will have an embedded table.

I am open for any suggestion, this is the only solution I can think of.

How to display a custom taxonomy as a dropdown list

//According to this code, How can I create a dropdown list to display a taxonomy & when I click on taxonomy it should show subcategory of it and it will show the posts of that subcategory when I click on it… I hope you understand what is my problem…

function diwp_arts_custom_post_type(){

// here I am setting labels for custom post type

$labels = array(
                 'name' => 'Arts',
                 'singular_name' => 'Art',
                 'add_new'    => 'Add New Post',
                 'add_new_item' => 'Enter Art Details',
                 'all_items' => 'All Arts',
                 'featured_image' => 'Add Feature Image',
                 'set_featured_image' => 'Set Feature Image',
                 'remove_featured_image' => 'Remove Feature Image'


// here I am setting Options for custom post type

$args = array(    
                'public' => true,
                'label'       => 'Arts',
                'labels'      => $labels,
                'description' => '  Arts is a collection of all Art and their info',
                'menu_icon'      => 'dashicons-art',    
                'supports'   => array( 'title', 'editor', 'thumbnail'),
                'capability_type' => 'page',

register_post_type('arts', $args);


add_action( ‘init’, ‘diwp_arts_custom_post_type’ );

function wpdocs_create_book_tax() {
register_taxonomy( ‘Types’, ‘arts’, array(
‘label’ => __( ‘Types’, ‘textdomain’ ),
‘rewrite’ => array( ‘slug’ => ‘arts’ ),
‘hierarchical’ => true,
) );

register_taxonomy( 'Categories', 'arts', array(
    'label'        => __( 'Categories', 'textdomain' ),
    'rewrite'      => array( 'slug' => 'arts' ),
    'hierarchical' => true,
) );


add_action( ‘init’, ‘wpdocs_create_book_tax’, 0 );

//Custom post type coding has been ended here

// Coding to create shortcode

function diwp_create_shortcode_arts_post_type( $atts ){

$atts = shortcode_atts( array(
    'type' => ' ',
), $atts );

$args = array(
                'post_type'      => 'arts',
                'posts_per_page' => '10',
                'post_status' => 'publish',
                'tax_query'     => array( array(
                            'taxonomy'  => 'Types',
                            'field'     => 'term_id',
                            'terms'     =>  wp_parse_id_list( $atts('type') ),
                        ) )

$query = new WP_Query($args);

if($query->have_posts()) :

    while($query->have_posts()) :

        $query->the_post() ;
    $result .= '<div class="art-item">';
    $result .= '<div class="art-image">' . get_the_post_thumbnail() . '</div>';
    $result .= '<div class="art-name">' . get_the_title() . '</div>';
    $result .= '<div class="art-desc">' . get_the_content() . '</div>';
    $result .= '</div>';




return $result;            


add_shortcode( ‘arts-list’, ‘diwp_create_shortcode_arts_post_type’ );

ilo – HP iLO4 Remote Console Java Applet display

We have an HP Proliant DL360 G8 server, with iLO4 installed. I normally uses Firefox to access the iLO web interfacefrom an Ubuntu server. The Ubuntu server hopped through 2 subnets to get to the iLO interface.

ubuntu$ xhost +
ssh -X
ssh -X
firefox -no-remote

Then https://… to logon to the iLO interface. However, when trying to run Remote Console using Java Applet, the normal Ice tea applet window is not showing anything, and there’re no remote window popping up. Is that because of export DISPLAY does not apply to JAVA applets? Is there something I can do to fix this?
enter image description here

datetime – View based on months or days – display certain items during specified times of the year

I am trying to create a calendar-type view that will display links to specific nodes during certain months of the year. For example, this would show ‘Taxes’ in Feb and April, ‘Travel’ from May to September, etc.

So far I have added a boolean field to my node to appear in the view, but I am stuck on how to implement the date selector. Theoretically I would like to have people select the months that this node should appear in the view, and the view will contextually display the nodes depending on the current month.

The problems I’m running into are:

  • The date field seems to require a year, but I want this to be year agnostic
  • The date field doesn’t allow selection of multiple months

I am thinking that I will have to use a date field so that I can use contextual filters to display based on month of the year. I don’t have access to the codebase so I need to do all of this within the UI using modules, if possible.

Any tips on how I can achieve this?

How to efficiently implement a 7-segment display?

I want to construct a 7 segment display (as shown below). When you input a number, the script will read the input number and light up the respective segment
(change the spriterenderer color to red) to display the number.

But I think the code has become too long, since there is 0-9 digit to display, I need 10 if statements, 8 scripts and the function of each statement is to light up the respective segment so it displays the number correctly.

Is there any better way to make the code shorter?

using UnityEngine;

public class ClockController :  MonoBehaviour
    Rect1 rect1;
    Rect2 rect2;
    Rect3 rect3;
    public GameObject othergameobjectrect2;
    public GameObject othergameobjectrect3;

    void Start()
        int x = 1;
        if (x == 1)
            rect1 = GetComponent<Rect1>();
            rect2 = othergameobjectrect2.GetComponent<Rect2>();

            rect3 = othergameobjectrect3.GetComponent<Rect3>();

using UnityEngine;

public class Rect3 : MonoBehaviour
    public void Rectangle3()
        GetComponent<SpriteRenderer>().color = Color.red;
using UnityEngine;

public class Rect2 : MonoBehaviour
    public void Rectangle2()
         GetComponent<SpriteRenderer>().color = Color.red; 
using UnityEngine;

public class Rect1 : MonoBehaviour
    public void Rectangle1()
        GetComponent<SpriteRenderer>().color = Color.red;    

enter image description here

unity – TextField Add in editor does not display when put under if statement

I’ve been trying to make a custom editor window in Unity, and i needed to make an “add TextField” button.
But when i add TextField directly ( without requiring a button ) it works
when i put it under if(GUI.Button()) it does not show up.
Here’s my code:

private static List<string> s = new List<string>();
private void OnGUI()
    if (GUI.Button("+");)
        s.Add(GUI.TextField(new Rect(0,50,Screen.width,20),"field"));

Toolset Types display custom term field

In Toolset Types I created a custom term field named “cp” with a color picker.

I’m trying to use the color in a title but I can’t make it work. I searched the DB and found the field as “wpcf-cp” so I tried to use it but it didn’t help.

Here’s my loop:

    $args = array(
        'post_type' => 'post'

    $post_query = new WP_Query($args);

    if($post_query->have_posts() ) {
        while($post_query->have_posts() ) {
            <div class="catalogue_item">
                <h2 style="color:<?php types_render_termmeta( "wpcf-cp", array() ); ?>"><?php the_title(); ?></h2>
                <a href="<?php echo get_permalink(); ?>">lien vers la fiche</a>
                    <?php foreach ( ( get_the_category() ) as $category ) {
                        echo $category->cat_name . ' ';
                <?php the_excerpt(); ?>
                <?php the_content(); ?>

If you can tell me what’s wrong it would help me greatly.

Thank you for reading

theming – What to use instead of raw filter for D9 in Display Suite templates?

Drupal 9 themeing documentation indicates that the Twig raw filter is deprecated in favor of verbatim. https://www.drupal.org/docs/upgrading-drupal/how-to-prepare-your-drupal-7-or-8-site-for-drupal-9/preparing-for-use-of-twig#s-template-facing-twig-2-changes

Twig 2 Verbatim: https://twig.symfony.com/doc/2.x/tags/verbatim.html

The ds-field-expert.html.twig template in Display Suite uses raw to render the input in the prefix and suffix field, which is often HTML. https://git.drupalcode.org/project/ds/-/blob/8.x-3.x/templates/ds-field-expert.html.twig#L16

{{- settings['prefix']|raw -}}

verbatim in the Twig 2 documentation is not a filter, but instead wraps around content in the template, so wrapping the line of code does not actually go and get the prefix/suffix content. It just renders the twig.

  1. What should I use instead of raw in this case so the HTML I enter into the prefix and suffix field of a Display Suite expert field template renders as HTML and not plain text?
  2. Will this template break in D9?

graphics card – After waking GNU/Linux up from suspend display stays turned off

Hello everyone,

I am trying to solve an annoying problem which happened to me, when I migrated one of my boxes (computers:) from Ubuntu to it’s fully FSF compliant equivalent called Trisquel. Both of these two platforms are actually based on Ubuntu distros, however Trisquel is free of all proprietary libraries and other software.

The source of the problem which, I believe, is the result of my migrating to Trisquel, is that Trisquel no longer properly recognizes my graphic hardware, i.e, my graphic board that is recognized as (ATI Radeon HD 4550, ATI Radeon RV710, ATI Radeon HD 4350 by lspci CLI command, as well as by whatever is the default fall back graphical driver, when the hardware is not properly identified during X-initialization process. Which you could see in the /var/log/Xorg.o.log, but which, together with my xorg.conf file, due to some rather dark, unexplained issues StackExchange trolls, hiding behind moderators and “bots”, have, I am prevented to publish here:(

Nevertheless, in this Xorg.o.log file, one can see, that my graphical board should require the open radeon driver to be loaded, which actually starts out to be the case, but is in the then further down the initialization process rejected and replaced with a default graphic driver, which I believe is the true culprit eventually even causing the suspend to exhibit its fatal flaw, of not waking up the display monitor. I believe that either or both of the two hardware pieces (my graphic board and/or the display monitor) are not EDID (Extended Display Identification Data compliant, which is actually accounted for in Ubuntu’s close radeon driver, but not in GNU/Linux FSF variant which uses open radeon graphic driver.

I was hoping, that reverting back to the good old Xorg.conf configuration file would solve the problem. Unfortunately, I was not able to accomplish that. Indeed I’ve tried to fix both approaches, the contemporary auto config, which utilizes external utilities, like xrandr, gtf, cvt, xvattr, etc, as well as the manual Xorg.conf configuration, that in the distant past would almost always work, providing, you supplied the correct hardware specifications in the configuration sections for your hardware.

And finally, regardless of whether we are able to solve “Xorg/suspend/monitor wake-up” problem, I would like to be able, indeed with some certainty, to identify what really the problem is. Primarily I wish to know it the problem is related to a graphic card, or a driver, and whether it would be possible to bypass the troubles, by replacing a graphic board with a different one. And last but not list, how can one learn which graphic cards are supported. As I have already pointed out, the list of supported hardware found in the Xorg.0.log file, can not be considered a reliable source!

Short of posting my xorg related files, lets look at how does my “Xorg/suspend” problem on Trisquel manifests itself?


When I the CPU (computer) exits the suspend state it fails to turn on the monitor. After searching the Internet for posts describing similar problems, some suggested the problem might be in some settings in GRUB. As suggested, I tweaked the line GRUB_CMDLINE_LINUX=”” as shown undeer 1.1.1, and 1.1.2 by doing the following:

        $> sudo vi /etc/default/grub
        #> sudo uodate-grub


 GRUB_CMDLINE_LINUX="" >>>> GRUB_CMDLINE_LINUX="nouveau.modest=0"

Run sudo uodate-grub and tested if waking up the computer from suspend also wakes up the display monitor.

It does not!

Changing this line to


      GRUB_CMDLINE_LINUX="" >>>> GRUB_CMDLINE_LINUX="amdgpu.modest=0

Also does not have any effect!


Next, I checked xrandr output which consistently, always, displayed the same output. In particular I could never really got rid of the following xrandr: Failed to get size of gamma for output default message:

    $> xrandr
    xrandr: Failed to get size of gamma for output default
    Screen 0: minimum 1600 x 1200, current 1600 x 1200,     \s
        maximum 1600 x 1200
    default connected primary 1600x1200+0+0 0mm x 0mm
       1600x1200     77.00* 


Changing –gamma value to 1.0 seems to fail with the resulting gamma value 0, as shown here:

        $> xrandr --output default --gamma 1.0:1.0:1.0
        xrandr: Gamma size is 0.


I could never get System -> Preferences -> Hardware -> Display to reflect any changes I make by running xrandr‘s –newmode, –addmode, though a subsequent query by running xrandr without any arguments (see 1.4.4) does show the new added mode:


        $> gtf 1920 1200 59.95
        # 1920x1200 @ 59.95 Hz (GTF) hsync: 74.46 kHz; pclk: 192.99 MHz
        Modeline "1920x1200_59.95"                                  \s
                       192.99   1920 2048 2256 2592                 \s
                                1200 1201 1204 1242  -HSync +Vsync


        $> xrandr --newmode "1920x1200_60.00"                       \s
                       193.25   1920 2056 2256 2592                 \s
                                1200 1203 1209 1245  -hsync +vsync


        $> xrandr --addmode VGA1 1920x1200_60.00


        $> xrandr
        xrandr: Failed to get size of gamma for output default
        Screen 0: minimum 1600 x 1200,                              \s
                       current 1600 x 1200,  maximum 1600 x 1200
        default connected primary 1600x1200+0+0 0mm x 0mm
         1600x1200     77.00* 
         1920x1200_60.00 (0x2bf) 193.250MHz -HSync +VSync
         h: width  1920 start 2056 end 2256 total 2592 skew 0 clock 74.56KHz
         v: height 1200 start 1203 end 1209 total 1245        clock 59.88Hz

None of the above has no effect, whatsoever, on the waking up of the display monitor when the computer wakes up from the suspend state.


I created ~/.xprofile and added the following to it:

    xrandr --output default --gamma 1.0:1.0:1.0
    xrandr --newmode "1920x1200_60.00" 193.25                   \s
                            1920 2056 2256 2592                 \s
                            1200 1203 1209 1245  -hsync +vsync
This <b>~/.xprofile</b> also had no effect on SUSPEND problem, and <b>Display</b> app from the main <i>Trisquel menu</i> also did mot show the newly added mode!

1.6 Conclusion of manual settings using {{ xrandr )) command

In all of the above attempts, in many different combinations, when selecting System -> Preferences -> Hardware -> Display I was never able to get whichever resolution I managed to set by running xrandr commands. Also note that –gamma setting finally always failed and had an erroneous value 0.

But most importantly, I was never able to wake up my screen when waking up the computer from the suspend state!


2. Falling back to xorg.conf configuration file

This is the part, which corporate culprits hiding between us in the open source source community, are trying to prevent us to discuss in fear we could actually achieve, that their proprietary crap may actually became useless in maintaining their monopolies.


So, first is my xord.conf file. I created a new xorg.conf file (which you can see under (2.2), and copied it in its palace as shown in the folowing code segment:

    $> sudo cp /etc/X11/xorg.conf   /etc/X11/xorg.conf.$(date +%y%m%d-%H%M)
    $> sudo cp xorg.conf-NN         /etc/X11/xorg.conf


Due to the above sabotage, I am prevented to share with you my xorg.conf file.


And the following should be my partial /var/log/Xorg.0.log file, which just like the xorg.conf may be dangerous to corporate monopolies, and which effectively they prevented me from showing it to you!

Please note,

ATI Radeon HD 4550, ATI Radeon RV710, ATI Radeon HD 4350

is my graphic card, as identified by

      $> sudo lspci |grep -y VGA
      01:00.0 VGA compatible controller:              \s
              Advanced Micro Devices, Inc. (AMD/ATI)  \s
              RV710 (Radeon HD 4350/4550)

as well as printed in the Xorg.0.log file. Also note how the header in the above output becomes the BusID, I created in the Devices section in my xorg.conf file.

        BusID    "PCI:1:0:0"

Needless to say, none of the above fixed the monitor wake up problem.

Any help or suggestions would be greatly appreciated.
Thank you in advance.