Code Monkey home page Code Monkey logo

Comments (6)

grzegorz-pietrzak-droptica avatar grzegorz-pietrzak-droptica commented on June 2, 2024 1

Hello, please put a d_custom_init module in your droopler_project starterkit and use the following code:

/**
 * Alter content structure.
 * Implements hook_content_structure_alter()
 *
 * @param $structure
 *  The array with structure.
 *
 * @param $context
 *  Which structure array is this?
 */
function d_custom_init_content_structure_alter(&$structure, $context) {
  $structure = [];
}

The installation process will run this hook and remove all demo nodes.

from droopler.

shivkashyap avatar shivkashyap commented on June 2, 2024

BTW I am refeering to droopler_project

from droopler.

shivkashyap avatar shivkashyap commented on June 2, 2024

Perfect. Thanks a lot for your prompt response.

from droopler.

shivkashyap avatar shivkashyap commented on June 2, 2024

d_custom_init worked. Is there anyway I can remove blogs examples. In the module d_blog module this is what I did to get rid of them. Is there any elegant way of doing it please?

  • Altered Function below

*function d_blog_init_content_structure_alter(&$structure, $context) {

  • $path = drupal_get_path('module', 'd_blog_init') . '/pages';

  • if ($context == 'all') {

  • $structure['blog_post_1'] = ['file' => "$path/post_1.yml"];

  • $structure['blog_post_2'] = ['file' => "$path/post_2.yml"];

  • $structure['blog_post_3'] = ['file' => "$path/post_3.yml"];

  • $structure['blog_post_4'] = ['file' => "$path/post_4.yml"];

  • $structure['blog_post_5'] = ['file' => "$path/post_5.yml"];

  • }
    *}
    */
    function d_blog_init_content_structure_alter(&$structure, $context) {
    $path = drupal_get_path('module', 'd_blog_init') . '/pages';

if ($context == 'all') {

}
}

from droopler.

ugintl avatar ugintl commented on June 2, 2024

@grzegorz-pietrzak-droptica did not work. I had to manually delete content.

from droopler.

grzegorz-pietrzak-droptica avatar grzegorz-pietrzak-droptica commented on June 2, 2024

@ugintl In 2.2 version there will be a functionality to choose demo content, https://www.drupal.org/project/droopler/issues/3155114

from droopler.

Related Issues (20)

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.