Can not create sub-theme Civic Theme

Created on 20 April 2024, 7 months ago
Updated 23 June 2024, 5 months ago

Hello Team,

I tried to following to create a sub-theme using provided script (do not skip this step if you want to receive the full benefits of the tooling provided with a sub-theme starter kit) :
php civictheme_create_subtheme.php
"Human theme name" "Human theme description" /path/to/theme_machine_name

But No luck for me to this step by run php script above. Any help to do this? Thanks!

the issue:
civictheme $php civictheme_create_subtheme.php
"Human theme name" "Human theme description" /path/to/theme_machine_name
-bash: theme_machine_name: No such file or directory

πŸ’¬ Support request
Status

Closed: works as designed

Version

1.7

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States smethawee

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @smethawee
  • πŸ‡¦πŸ‡ΊAustralia RichardGaunt Melbourne

    @smethawa It looks like you are trying to run it in the wrong directory because it did not find the `civictheme_create_subtheme.php` file

    You need to run the command in the civictheme file directory not your drupal root directory.

  • πŸ‡ΊπŸ‡ΈUnited States smethawee

    Thank you so much @RichardGaunt!!! Yes I did in the civictheme directory \docroot\themes\contrib\civictheme. Thanks!

  • HI @smethawee. I just want to confirm that your last message means you have had success, and I can close this request?
    Thank you.

  • Assigned to fionamorrison23
  • Status changed to Postponed: needs info 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smethawee

    Hi fionamorrison23,
    Not success yet. I still can't install in on that directory \docroot\themes\contrib\civictheme.
    Thanks you!

  • @smethawee I used this and it worked
    php civictheme_create_subtheme.php civictheme_demo "CivicTheme Demo" "Demo sub-theme for a CivicTheme theme."

  • πŸ‡¦πŸ‡ΊAustralia Toby Wild

    Hi smethawee.

    This worked for me today:

    In the directory /themes/civictheme

    On the command line I ran:

    php civictheme_create_subtheme.php cttesttheme "Test Theme" "Human theme description" ../cttest

    Breaking that down it goes as:

    1. php: running a PHP command on the command line
    2. civictheme_create_subtheme.php: Triggering that file
    3. cttestheme: That is the machine name of the theme I want to create
    4. "Test Theme": Is the human readable name
    5. "Humn theme description": That is the theme description
    6. ../cttest: Means go back one directory (Back into /themes) and create it in the new folder "cttest"

    If you just straight up copy and paste the suggested command without changing the theme machine name and path arguments, it wont work.

    If this doesn't work for you, can you provide what error you are seeing, or what outcome is happening at all?

  • πŸ‡ΊπŸ‡ΈUnited States smethawee

    Hi @claire.cb @Toby Wild,

    Thank you for your time and attention to this matter. I appreciate very much!!! I still struck now with php command. I ran DDEV as local please see below that the issue.

    Thank you,

    -----------------------------------------------------------
    ddev php civictheme_create_subtheme.php civictheme_demo "CivicTheme Demo" "Demo sub-theme for a CivicTheme theme."
    Could not open input file: civictheme_create_subtheme.php
    Failed to run php civictheme_create_subtheme.php civictheme_demo CivicTheme Demo Demo sub-theme for a CivicTheme theme.: exit status 1
    ------------------------------------------------------------

    php civictheme_create_subtheme.php cttesttheme "Test Theme" "Human theme description" ../cttest

    Command 'php' not found, but can be installed with:
    sudo apt install php7.4-cli

  • Status changed to Closed: works as designed 5 months ago
  • πŸ‡¦πŸ‡ΊAustralia alex.skrypnyk Melbourne

    @smethawee
    This is a php script that you need to run from the `civictheme` directory.

    `ddev php` runs a script in the root of the project rather than in the specified directory. We cannot provide support for specific installations - we simply do not know how you have your project configured. Please consult DDEV documentation on how to run scripts from a specific directory.

    Please follow the steps specified here https://docs.civictheme.io/development/drupal-theme/sub-theme

Production build 0.71.5 2024