Skip to content

BoldizArt/UsefulDrupal8Functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

USEFUL DRUPAL8 FUNCTIONS alt text


1 Get current path, route name and path alias by current path: CurrentPathRouteNameAndPathAlias.php

2 Load the current node and check its type: CurrentNodeType.php

3 Get current language code and name: CurrentLangcodeAndLangname.php

4 Date formatter service: DateFormatterService.php

5 Create node programatically: CreateNodeProgrammatically.php

6 List field names for a content type: listFieldNamesForAContentType.php

7 Get node ids by content type: GetNidsByContentType.php

8 Load node by id and load multiple nodes by ids: LoadNodeById.php

9 Render a view programmatically with contextual filter: RenderViewWithContextualFilter.php

10 Get taxonomy term ids by vocabulary name: GetTidsByVocabularyName.php

11 Check if a module is enabled: CheckIfAModuleIsEnabled.php

12 Load taxonomy term by name: LoadTaxonomyTermByName.php

13 Get the current users data: GetTheCurrentUsersData.php

14 Generate uuid for the current user: GenerateUuidForTheCurrentUser.php

15 Authenticate user by username and password: AuthenticateUserByUsernameAndPassword.php

16 Get type of entity field by field name: GetEntityFieldType.php

17 Ceck is the entity has field: CheckIfEntityHasField.php

18 Check is the current commerce cart has items: CheckIsCommerceCartHasItems.php

19 Load file by id and get its values: LoadFileByIdAndGetItsValues.php

20 Get taxonomy term by taxonomy term id: GetTaxonomyTermByTid.php

21 Logging in Drupal 8: LoggingInDrupal8.php

22 Get the sitename and the slogan programmatically: GetSitenameAndSloganProgrammatically.php

Functions in Twig template


1 Get path alias by id or route name: GetPathAliasByIdOrRouteName.twig

2 Translate function with dynamic variables: TranslateFunctionWithDynamicVariables.twig

3 Include part template with and without variables: IncludePartTemplateWithAndWithoutvariables.twig

4 Debug in Twig: DebugInTwig.twig

About

Useful Drupal 8 functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published