Clarification: All about Drupal
To Be filed
Drupal 9, 10 develop tools
Debug
- ChatGPT
- The quick & dirty way (NOT for production)
print '<pre>';
print_r($Objct);
print '</pre>';
exit;
- php way - not always work with Drupal
- not for filter code for sure
- php way - not always work with Drupal
- Better:
kint()(requires Devel module) - did not try- need install Devel module
can use kint() or dpm()
kint(\Drupal::currentUser());
- kint() only works if Devel is enabled and
- Kint debugging is turned on
- need install Devel module
- Logging instead of printing - pretty good
- do not break page rendering
\Drupal::logger('LgGrpNmAny')->debug(
'<pre><code><pre>@Objct</pre></code></pre>',
[ '@Objct' => print_r(\Drupal::currentUser(), TRUE), ]
);
- in Drupal: -Reports -Recent log messages
- 'current user' specific
- \Drupal::currentUser() **doesn’t give you a full
Userentity- it gives you a
AccountProxyobject (basically a lightweight wrapper).
- it gives you a
- if you want details:
$user = \Drupal::currentUser();
print $user->id();
print $user->getAccountName();
- \Drupal::currentUser() **doesn’t give you a full
- The quick & dirty way (NOT for production)
Learn - General
Tutorial 🌐
- Intro - many topic
- Docker - DDEV
- Built-in module
- etc...
- video 19 - create new content type
- video 20 - managing fields and field settings
- video 24 - Taxonomy
- video 33 - introduction to views
- v9 and above use twig
D9+ module development - Youtube 🌐
Wiki related 👀
- video/Youtube, modules used, people involved
SSL/HTTPS
-
Drupal Doc 🌐
- Encourage use HTTPS for all pages
- "Let's Encrypt" mentioned and should work
- HTTP to HTTPS redirect still hackable
- mitigation mentioned (e.g. HSTS)
- many settings/cofig is also possible through settings.php
- see misc1 Drupal setup in Alwyzn 2 Setup
Taxonomy
- create terms from node field
- don't seems to have a module
- Can generate terms from field data?
- for use in view filter
OIDC
Permission
Learn - Module
Install moudle
- ...
Freelinking
-
Module 🌐
- What it does
- Freelinking provides a filter framework for easier creation of HTML links to other pages on your site or to external sites.
- DH: it detect special (linking) syntax in text and act on it, like:
- replace with HTML syntax - depend on specified filder
- on target link not exist, perfrom tasks
- Drupal 8 Doc 🌐
- Drupal 7 Doc 🌐
-
Fileters 🌐
- look like apply to both Drupal 7 and 8
-
Custom filter 🌐
- Drupal 8 - I think
- What it does
Forum
Feeds
-
v7 🌐
- install, instruduction
- -structure -feeds import -new -name -description -create
- -Basic settings -Attach to content type=standalone form??
- -Periodic import = off -Import on submission = check -Process in background
- -Fetcher -File upload = check -HTTP fetcher = uncheck
- -Parser -pick CSV parser //based on file format
- -Processor // drupal entity to process to
- -Node processor // more detail on node processor
- -new node -content type -author = user -Expire nodes = expiration length
- -mapping //map fields
- -Node processor // more detail on node processor
-
v7 🌐
- import csv
- -new content type -save/create -add fields
- -structure -feed importers -new or an old one -edit
- -Basic settings -Attach to content type=standalone form?? // article
- -Periodic import = off -Import on submission = check -Process in background
- -Fetcher -File upload = check -save -File upload Settings -Allowed file extensions -path //can preset
- -Parser -CSV parser = check -save -CSV parser Settings -default delimiter = , -header row
- -Processor -Node processor = check -save -Processor settings
- -Update exsiting nodes = check -Text format = Plain text -Content type = Feed //input?
- go to site/import/
-
v7 🌐
- import RSS
- -structure -feed importers -new
- -Basic settings ...
- -Fetcher -HTTP Fetcher = check -save -Settings // auto detect feeds?
- -Parser -Common syndication parser = check -save -Common syndication Settings
- -Processor -Node processor = check -save
- -Processor setting -Update exsiting nodes = check -Text format = Plain text -Content type = Feed
- -Mapping
- Another 🌐
Building Wiki 🌐
v7 Wiki 🌐
Learn - Install Drupal
Installation - Drupal Doc 🌐
- 3.1 Server Requirement
- 3.2 Additional Tools
-
3.3 Ways to Download Core Software 🌐
-
Download - Drupal Doc 🌐
- traditional install
-
via Composer - Drupal Doc 🌐
- composer templates
- recommended (project)
//Directory structure
web
- index.php
- core/
composer.json
vendor/
- legacy (project)
//Directory structure
index.php
core/
composer.json
vendor/
- recommended (project)
- install
//e.g.
> composer create-project drupal/recommended-project:8.8.0 TrgtFldr
- check Packagist.org
>cd TrgtFldr
//add (Drupal) module
> composer require drupal/MdlNm
//add (Drupal) Dev module
> composer require --dev drupal/MdlNm
//check outdated packages
> composer outdated 'drupal/*'
//update all module include the core
> composer update
//update only core
> composer update drupal/core-recommended --with-dependencies
//update core and its dependencies
> composer update drupal/core 'drupal/core-*' --with-all-dependencies ??diff to the above??
- can use git too!!
- composer templates
-
Download - Drupal Doc 🌐
- 3.4 Preparing to Install
- 3.5 Download with Composer 🌐
- 3.6 Manually download Drupal Core
-
3.7 Run interactive installer 🌐
- Before run the script, I think I need make sure the site is setup for Apache !!