Is there a way to get to sitecore settings through code.
The specific setting I'm interested in is the data Folder path.
If you'd like to get other settings, you may want to try:-
Sitecore.Configuration.Settings.GetSetting("SettingName");
This will work for all sitecore settings, even your custom settings that can be added through the config files in the App_config/Include.
Yes. Look at the Sitecore.Configuration.Settings class (which is your entry point to the Sitecore settings), and use the static DataFolder property:
string dataFolder = Sitecore.Configuration.Settings.DataFolder;
Related
I am developing a plugin for MITK, which is a tookit for medical imaging. I want to access the full path of image that is loaded in the data manager.
There are properties of images like name, opacity, path etc.
I searched MITK documentation but I could not find any proper information related to that.
Can you please help me?
If you want to see the 'path' in the UI, you can use the Properties plugin, available in the MITK Workbench and in your own app if you decided to include it.
If you want to access the content of the 'path' property in the code, then you need a mitk::DataNode in the current scope, because properties are usually related to node.
std::string path;
node->GetStringProperty("path", path);
Note that this won't give you the full path though. For some reason, MITK decided to remove the extension in this property, thus giving something like D://Data/brain instead of the D://Data/brain.nii.gz that I wanted.
AFAIK, there's currently no 100% safe way to get the real full path in MITK, but one could easily search on the file system using path + ".*" and hoping that it returns only one result :)
The property is not on the DataNode but in the BaseData in it. There is a 'path' property there. You can see its value when right-click the image and selecting 'details'
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.
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.
Went to Configuration - Design and changed everything at template section to Default.
After that I het this at each admin page.
Fatal error: Call to a member function setActive() on a non-object in /home/white/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php on line 96
No I can't even turn it back! How to fix it? How to turn it back at least... Maybe directly through MySQL
Also, Magento was updated from 1.5 to 1.6 not so far.
Have a look at the table core_config_data
I do not recall the exact configuration paths, so you could do something like this:
SELECT * FROM core_config_data WHERE path like "%theme%"
SELECT * FROM core_config_data WHERE path like "%skin%"
This will show you the currente theme and skin configuration settings. Then you can use an
UPDATE core_config_data SET value = "workingskin" WHERE path = "configuration/path/goes/here"
to change the skin and theme. (the path must be replaced by what you just found out using the above SELECT.
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