কেবলমাত্র নিশ্চিত করার জন্য, ড্রুপাল 8 এ আপনি নির্দিষ্ট ব্লকের জন্য প্রিপ্রসেস ফাংশন লিখতে পারেন। উদাহরণ স্বরূপ:
দ্রুপাল ৮
mytheme_preprocess_block__system_branding_block(&$vars) {
// Make changes to the the system branding block
}
তবে আপনি হুক_প্রিপ্রসেস_ব্লক এবং প্লাগইন আইডিও ব্যবহার করতে পারেন:
function mytheme_preprocess_block(&$vars) {
if ($vars['plugin_id'] == 'system_branding_block') {
// Make changes to the the system branding block
}
}
অ্যালেক্স দ্বারা উল্লিখিত হিসাবে, ড্রুপাল 7 এ আপনাকে HOOK_preprocess_ block, এবং একটি আইডি চেক দিয়ে আটকাতে হবে:
দ্রুপাল 7
mytheme_preprocess_block(&$vars) {
if ($vars['block']->bid === 'target_block_id') {
// make changes to this block
}
}