Setting variable inside config

I would like to be able to set a variable inside config.php file for some plugins options like

'cre8ivclick.sitemapper.title' => 'Sitemap of'. $site->title() .' well done',

I tried many things I didn’t get nothing more than a blank page due to an error.
Is that possible ? Can we use $site or $page for example ?

May be you should try ready option to access kirby objects:

I would try to set it in an own self made plugin.

Ok, I didn’t know that callback. It’s working well, but my goal was to configure a custom plainkit for my futur works and I feel like my config file is not as organized as expected with this function. As you can see here (and it could be more complex as the project gets bigger).

'ready' => function ($kirby) {
        return [
            'cre8ivclick.sitemapper.title' => 'Sitemap de '. $kirby->site()->title() . '',
            'omz13.wellknown.the-humans' => '* SITE */\nMise à jour: '. $kirby->site()->modified('d/m/Y H:i') . '\nStandards: HTML5, CSS3, PHP\nSoftware: Brackets, MAMP',
            'omz13.wellknown.the-security' => '/* CODE */\n'. $kirby->site()->url() . '/.well-known/security.txt',

'debug' => true,
'smartypants' => true,
'markdown' => ['extra' => true],

/* TUMBS */
'thumbs' => [
    'srcsets' => [
        'default' => [
            '800w' => ['width' => 800, 'quality' => 80],
            '1024w' => ['width' => 1024, 'quality' => 80],
            '1440w' => ['width' => 1440, 'quality' => 80],
            '2048w' => ['width' => 2048, 'quality' => 80]
'medienbaecker.autoresize.maxWidth' => 1920,

'cre8ivclick.sitemapper.intro' => 'Le sitemap contient <strong>[[count]]</strong> URLs',

'omz13.wellknown.the-robots' => '',
'omz13.wellknown.the-humans' => '/* SITE */\nMise à jour: \nStandards: HTML5, CSS3, PHP\nSoftware: Brackets, MAMP',
'omz13.wellknown.the-dntpolicy' => 'Do Not Track Compliance Policy\n\nVersion 1.0\n\nThis domain complies with user opt-outs from tracking via the "Do Not Track" or "DNT" header []. This file will always be posted via HTTPS at to indicate this fact.\n\nSCOPE\n\nThis policy document allows an operator of a Fully Qualified Domain Name ("domain") to declare that it respects Do Not Track as a meaningful privacy opt-out of tracking, so that privacy-protecting software can better determine whether to block or anonymize communications with this domain. This policy is intended first and foremost to be posted on domains that publish ads, widgets, images, scripts and other third-party embedded hypertext (for instance on, but it can be posted on any domain, including those users visit directly (such as The policy may be applied to some domains used by a company, site, or service, and not to others. Do Not Track may be sent by any client that uses the HTTP protocol, including websites, mobile apps, and smart devices like TVs. Do Not Track also works with all protocols able to read HTTP headers, including SPDY.\n\nNOTE: This policy contains both Requirements and Exceptions. Where possible terms are defined in the text, but a few additional definitions are included at the end.\n\nREQUIREMENTS\n\nWhen this domain receives Web requests from a user who enables DNT by actively choosing an opt-out setting in their browser or by installing software that is primarily designed to protect privacy ("DNT User"), we will take the following measures with respect to those users’ data, subject to the Exceptions, also listed below: \n\n1. END USER IDENTIFIERS: \n\n a. If a DNT User has logged in to our service, all user identifiers, such as unique or nearly unique cookies, "supercookies" and fingerprints are discarded as soon as the HTTP(S) response is issued. \n\n Data structures which associate user identifiers with accounts may be employed to recognize logged in users per Exception 4 below, but may not be associated with records of the user’s activities unless otherwise excepted.\n\n b. If a DNT User is not logged in to our service, we will take steps to ensure that no user identifiers are transmitted to us at all. \n\n2. LOG RETENTION: \n\n a. Logs with DNT Users’ identifiers removed (but including IP addresses and User Agent strings) may be retained for a period of 10 days or less, unless an Exception (below) applies. This period of time balances privacy concerns with the need to ensure that log processing systems have time to operate; that operations engineers have time to monitor and fix technical and performance problems; and that security and data aggregation systems have time to operate.\n\n b. These logs will not be used for any other purposes. \n\n3. OTHER DOMAINS: \n\n a. If this domain transfers identifiable user data about DNT Users to contractors, affiliates or other parties, or embeds from or posts data to other domains, we will either: \n\n b. ensure that the operators of those domains abide by this policy overall by posting it at /.well-known/dnt-policy.txt via HTTPS on the domains in question,\n\n OR\n\n ensure that the recipient’s policies and practices require the recipient to respect the policy for our DNT Users’ data.\n\n OR \n\n obtain a contractual commitment from the recipient to respect this policy for our DNT Users’ data.\n\n NOTE: if an “Other Domain” does not receive identifiable user information from the domain because such information has been removed, because the Other Domain does not log that information, or for some other reason, these requirements do not apply.\n\n c. "Identifiable" means any records which are not Anonymized or otherwise covered by the Exceptions below.\n\n4. PERIODIC REASSERTION OF COMPLIANCE: \n\n At least once every 12 months, we will take reasonable steps commensurate with the size of our organization and the nature of our service to confirm our ongoing compliance with this document, and we will publicly reassert our compliance.\n\n5. USER NOTIFICATION: \n\n a. If we are required by law to retain or disclose user identifiers, we will attempt to provide the users with notice (unless we are prohibited or it would be futile) that a request for their information has been made in order to give the users an opportunity to object to the retention or disclosure.\n\n b. We will attempt to provide this notice by email, if the users have given us an email address, and by postal mail if the users have provided a postal address. \n\n c. If the users do not challenge the disclosure request, we may be legally required to turn over their information.\n\n d. We may delay notice if we, in good faith, believe that an emergency involving danger of death or serious physical injury to any person requires disclosure without delay of information relating to the emergency.\n\nEXCEPTIONS\n\nData from DNT Users collected by this domain may be logged or retained only in the following specific situations:\n\n1. CONSENT / "OPT BACK IN" \n\n a. DNT Users are opting out from tracking across the Web. It is possible that for some feature or functionality, we will need to ask a DNT User to "opt back in" to be tracked by us across the entire Web. \n\n b. If we do that, we will take reasonable steps to verify that the users who select this option have genuinely intended to opt back in to tracking. One way to do this is by performing scientifically reasonable user studies with a representative sample of our users, but smaller organizations can satisfy this requirement by other means. \n\n c. Where we believe that we have opt back in consent, our server will send a tracking value status header "Tk: C" as described in section 6.2 of the W3C Tracking Preference Expression draft:\n\n\n\n2. TRANSACTIONS \n\n If a DNT User actively and knowingly enters a transaction with our services (for instance, clicking on a clearly-labeled advertisement, posting content to a widget, or purchasing an item), we will retain necessary data for as long as required to perform the transaction. This may for example include keeping auditing information for clicks on advertising links; keeping a copy of posted content and the name of the posting user; keeping server-side session IDs to recognize logged in users; or keeping a copy of the physical address to which a purchased item will be shipped. By their nature, some transactions will require data to be retained indefinitely.\n\n3. TECHNICAL AND SECURITY LOGGING: \n\n a. If, during the processing of the initial request (for unique identifiers) or during the subsequent 10 days (for IP addresses and User Agent strings), we obtain specific information that causes our employees or systems to believe that a request is, or is likely to be, part of a security attack, spam submission, or fraudulent transaction, then logs of those requests are not subject to this policy. \n\n b. If we encounter technical problems with our site, then, in rare circumstances, we may retain logs for longer than 10 days, if that is necessary to diagnose and fix those problems, but this practice will not be routinized and we will strive to delete such logs as soon as possible. \n\n4. AGGREGATION:\n\n a. We may retain and share anonymized datasets, such as aggregate records of readership patterns; statistical models of user behavior; graphs of system variables; data structures to count active users on monthly or yearly bases; database tables mapping authentication cookies to logged in accounts; non-unique data structures constructed within browsers for tasks such as ad frequency capping or conversion tracking; or logs with truncated and/or encrypted IP addresses and simplified User Agent strings.\n\n b. "Anonymized" means we have conducted risk mitigation to ensure that the dataset, plus any additional information that is in our possession or likely to be available to us, does not allow the reconstruction of reading habits, online or offline activity of groups of fewer than 5000 individuals or devices. \n\n c. If we generate anonymized datasets under this exception we will publicly document our anonymization methods in sufficient detail to allow outside experts to evaluate the effectiveness of those methods.\n\n5. ERRORS: \n\nFrom time to time, there may be errors by which user data is temporarily logged or retained in violation of this policy. If such errors are inadvertent, rare, and made in good faith, they do not constitute a breach of this policy. We will delete such data as soon as practicable after we become aware of any error and take steps to ensure that it is deleted by any third-party who may have had access to the data.\n\nADDITIONAL DEFINITIONS\n\n"Fully Qualified Domain Name" means a domain name that addresses a computer connected to the Internet. For instance,;;; and are all distinct FQDNs.\n\n"Supercookie" means any technology other than an HTTP Cookie which can be used by a server to associate identifiers with the clients that visit it. Examples of supercookies include Flash LSO cookies, DOM storage, HTML5 storage, or tricks to store information in caches or etags.\n\n"Risk mitigation" means an engineering process that evaluates the possibility and likelihood of various adverse outcomes, considers the available methods of making those adverse outcomes less likely, and deploys sufficient mitigations to bring the probability and harm from adverse outcomes below an acceptable threshold.\n\n"Reading habits" includes amongst other things lists of visited DNS names, if those domains pertain to specific topics or activities, but records of visited DNS names are not reading habits if those domain names serve content of a very diverse and general nature, thereby revealing minimal information about the opinions, interests or activities of the user.',

But no problems, it’s working :slight_smile:
Thank you very much

Haven’t tried, but it should be possible to outsource the return array to a separate file to keep things organized.