#! code: Drupal 10: Programatically Injecting Context Into Blocks

Context definitions in Drupal are really useful when you want to inject context into your plugins and I have been using them for a little while now. It has made building custom blocks to add content to pages much easier as I don’t need to copy the same block of code to find an entity of a particular sort into the block plugin.

One problem I encountered when using this technique was when trying to programatically create and render a block. The problem was that the context wasn’t available in the block when it was used in this way, and it took me a little investigation to find out how to put all of the pieces together.

Rendering a block programatically is sometimes a necessity to do when you need the block outside of the block’s normal region. You might create a block that collects together the output of a number of blocks, which allows you to template them together in a very precise way. You might also need to print out a block without having to create a region on a page.

There are a few steps involved in getting things working in this way. In this article I will show how to print blocks programatically, and how to do so using context.

To show the problem in detail, let’s take an example of a block called UserContextBlock that has a user entity as the available context. This is a custom block, created in a custom module.

Read more

solidity gem – (fuzzy quick & dirty) parser for (crypto) contracts for ethereum & co.

Hello, in the ongoing crypto winter programming series in ruby I added yet another gem, that is, solidity that ships with a (fuzzy quick & dirty) parser for the solidity (contract) programming language. What’s the point? The first usage sample is to generate outlines from contract sources – see some real-world examples in the readme. Happy blockchaining with ruby. Cheers. Prost.

Execute-only status report

Theo de Raadt (deraadt@) posted
to tech@ a
status report
(and 2
test programs)
regarding execute-only (xonly).
The report begins:

We've made good progress in the xonly effort so here's a small summary.

architectures crossed over completely

	arm64 - X bit without implied R in mmu
	riscv64  - X bit without implied R in mmu
	amd64 - using hardware 'PKU' feature
	powerpc64 - using feature similar to PKU
	hppa - using gateway feature

Budgie 10.7 released

Budgie 10.7 is a brand new release series for Budgie Desktop, featuring major re-architectures, new APIs for extensibility, and polish to the user experience. For a point release, there’s a lot of changes, improvements, and new features in here, as the release notes detail. The changes are all over the place – from a brand new application indexer to replace libgnome-menus, to dual-GPU support, notification improvements, general UX improvements, and much more.

फ़्री में shooping करो 2023 #snapdeal

Video by via Dailymotion Source फ्री में शॉपिंग करा 2030 न्यू वीडियो 2023 में शॉपिंग कैसे करें फ्री में न्यू वीडियो आउट डेली मोशन एंड ग्रेट यूट्यूब फेसबुक इंस्टाग्रामFamous shopping Amazon app seफ्री में शॉपिंग कैसे करें निशू ऐप वीडियो डेलीमोशन न्यू वीडियो शॉपिंग एप स्नैपडील Go to Source

Dakar Yunus Emre Enstitüsünden Senegalli yazarlara destek

Video by via Dailymotion Source Dakar Yunus Emre Enstitüsü (YEE), Senegalli şair Alassane Koume’nin kitap tanıtımına ev sahipliği yaptı. Dakar YEE’de, aynı zamanda akademisyen olan Koume’nin “Un Eternal Optimiste” (İflah olmaz iyimser) kitabının tanıtımı yapıldı.Koume, tanıtımın ardından okuyucuların sorularını yanıtlayarak onlarla sohbet etti.Yerel ortaklarla çalışmanın kültürel etkileşim üzerindeki önemine vurgu yapan Dakar YEE Koordinatörü Merve … Read more