Where to get Settings for a Yesod Subsite from? - yesod

The yesod scaffolding provides Settings.Extra which can be used to configure the master site. But in the case of subsites like gitit2 this can't be used, can it?
Is there any way to put the subsites configuration in the main config/settings.yml or should one use a separate yaml file, e.g. config/gitit2.yml. How can I easily reuse Yesods config machinery in the latter case?

You could define a settings type in the subsite that has a FromJSON instance, and then include that inside the config/settings.yml file. Then just include a value of that subsite settings type in your Extra data type and things should fall out correctly.

Related

Bitrix component and module customisation

I am working with Bitrix24. I want to customise the component and module of Bitrix24.
But I didn't have the standard documentation for this.
Some one help me for the same,how we can work with local folder for customise component and module etc.
If you need to change logic of component you may do through this way:
create the local folder in your documet_root path
create components folder in the local folder
create bitrix folder in the components folder
copy component folder from /bitrix/components/bitrix to
/local/components/bitrix
edit logic in the component.php file (or in class.php file if
component using new bitrix core - D7) in the copied folder
If you need to change only the view, this is another way:
Instead of creating the /local/components/bitrix you have to
create /local/templates/.default/ folder
Copy there only the .default template of a needed component
Edit template.php file
With the second way, you also may change (or rich it) some data in final $arResult array provided for the template.php, just create result_modifier.php file in the template directory.
You can find this and other information in the free course Bitrix Framework, pay attention to this link, it will be very helpful

Laravel Admin Directory

I am trying to separate my admin code from my public code, I want to create 2 different directories in my app folder and resources folder, 1 directory named backend which contains all my admin code and another named frontend which contains public related code.
Each directory will have their own separate controllers.
Basically something like this:
-App
--frontend
--backend
-resources
--views
---frontend
---backend.
If there is a better way to do this i would also like to know.
By default you composer.json is autoload all in app. So you can make the structure which you described above.
Frontend and backend separating usually used for Controllers, in this case you need to make a correct namespace.
With views you would'n have any porblems. Just make a correct path when you calling your views.
For example:
view(frontend/index); // you can use dot instead of /

Mura 6.1 Include cfm page error

I am using this code for display my page in page content in MURA 6.1
<div>[mura]$.dspInclude('display_objects/custom/main.cfm')[/mura]</div>
But it gives me the error below:
Note: If you wish to use an absolute template path (for example,
template="/mypath/index.cfm") with CFINCLUDE, you must create a
mapping for the path using the ColdFusion Administrator. Or, you can
use per-application settings to specify mappings specific to this
application by specifying a mappings struct to THIS.mappings in
Application.cfc. Using relative paths (for example,
template="index.cfm" or template="../index.cfm") does not require the
creation of any special mappings. It is therefore recommended that you
use relative paths with CFINCLUDE whenever possible. Could not find
the included template
/muraWRM/default/includes/display_objects/custom/main.cfm.
The physical path is
[siteid]/default\includes\themes\rescue\display_objects
Thanks in advance
This should work
<div>[mura]$.dspInclude('themes/rescue/display_objects/custom/main.cfm')[/mura]</div>
Your include is being called from the includes folder, so you need to include the themes folder and the rescue folder to get to the right path.
For consistency across themes, you might want to use Mura's setting for the theme name, but I would have to look that up.
If you are ok hard coding it, this should work just fine.

Coldfusion mapping cfinclude

I am trying to use mappings for the first time and I am having some issues. In my CFadmin I created a mapping which goes like this:
Logical Path:
/email_sender
Directory Path:
E:\sites\Example.Com\cf_modules\autoresponders\Emails\emailLists
I am trying to access the include file from a .cfc. Inside my cfc I have an include file which is in the same folder and it works just fine but that include file is tying to access another include file based on the information I am passing through.
The include file inside the component has this code in it.
<cfmail from="#emailData.sender#" to="#surveymain.email#" subject="#subject#" type="HTML" >
<cfinclude template="#emailData.includePath#" >
</cfmail>
Just to be more clear this is my total filesystem:
access.cfm -> some.cfc -> include_1 (works) -> include_2 (issue with
the path)
I have a try/catch which emails me the errors and it is located inside the include_1.
How can I use the mapping that I created to finally be able to access my include file?
Please note that after emailLists I have dynamic folders which change depending on which client I am trying to send the email to. So the end result of the path would be:
E:\sites\Example.Com\cf_modules\autoresponders\Emails\emailLists\client_A\email_template.cfm
I tried using my mapping by doing this
<cfinclude template="/email_sender/#emailData.includePath#" >
which gave me this error:
The path to the CFC must be specified as a full path, or as a relative
path from the current template, without the use of mappings.
Also, I tried including a full path in the cfinclude whic also resulted in the following error:
Note: If you wish to use an absolute template path (for example, >template="/mypath/index.cfm") with CFINCLUDE, you must create a
mapping for the path using the ColdFusion Administrator. Or, you can
use per-application settings to specify mappings specific to this
application by specifying a mappings struct to THIS.mappings in
Application.cfc. Using relative paths (for example,
template="index.cfm" or template="../index.cfm") does not require the
creation of any special mappings. It is therefore recommended that you
use relative paths with CFINCLUDE whenever possible.
Any help/suggestion would be much appreciated
Edit:
After restarting the server the version that worked was this one:
<cfinclude template="/email_sender/#emailData.includePath#" >
Thanks to those who replied.
Some questions, rather than some answers.
Did you set the mapping in CFAdmin or in Application.cfc?
What do you get if you run the code below?
#expandPath("/email_sender")#
What is the value of #emailData.includePath#?
What is the value of this: #expandPath("/email_sender#emailData.includePath#")#?
Can you provide us with the exact text of the error messages, rather than vaguely describing them.
What is the value of #fileExists(expandPath("/email_sender#emailData.includePath#"))#?
If you can update your question with that info, you'll either spot where you're going wrong, or we can help to work out what the story is
Something like this happened to me once before. Essentially we edited the xml file, rather than using the admin interface. It wasn't until our sys admin restarted the server until we realized why the mapping hadn't taken. So have you restarted the server since you added the mapping?

Coldfusion mapping error

Note: If you wish to use an absolute template path (for example,
template="/mypath/index.cfm") with CFINCLUDE, you must create a
mapping for the path using the ColdFusion Administrator.
I went to the administration page but not sure what to put in here.
I'm pretty new to coldfusion. anyone got any ideas why this would be happening.
CFINCLUDE uses relative paths in relation to the file where the cfinclude is, so if want to include a file in another directory, 1. it has to be inside your wwwroot (or the root directory, or subdirectories) of your site, 2. you can go to other directories by doing ... hope this helps a little bit. If you want to include a file that is outside of your wwwroot, then you'll need to map that directory in Coldfusion Administrator using the same syntax above when you do include it.
To add a mapping, open your coldfusion administrator.
Server Settings > Mappings
There are 2 paths. Logical and Directory.
Logical can be anything you want, and directory is where it maps to.
eg. you might have a folder below your web root which stores email templates mapped as:
logical path: /emails
directory path: /var/www/mycfapp/content/includes/emails
You can <cfinclude template="/emails/forgotPass"> from any cf template and the mapping would get picked up.
You can use the mappings for new object creation too. Lets pretend forgotPass is a cfc.
fp = new emails.forgotPass();
// if you have funky characters in there, eg dash, just quote it.
fp = new "emails.forgot-pass"();
Mappings also work when extending cfcs. With one small exception. No leading slash.
component extends="emails/forgotPass" {
// ...
}
Im pretty sure mappings are detected first, so if you have a folder with the same name it might not get picked up.
In cf9 you can also specify your mappings in your Application.cfc, instead of coldfusion administrator, which affects all applications on your server. eg.
this.mappings["/emails"] = "/var/www/mycfapp/content/includes/emails";
You'll need to tick the Enable Per App Settings option on the cfadmin Settings page.
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0b63c-7fd5.html