Trying to add file by drupal_add_js(…) in pixture_reloaded_process_html function takes no effect
Simply you should add files in pixture_reloaded.info theme file.
stylesheets[all][] = relative_path/mystyle.css
scripts[] = relative_path/myscript.js
Related
I am working on a drupal7 site.
In Dev, I have enabled and configured simplesamlphp_auth module.
I used features and strongarm to export the configuration to code.
The downloaded feature contain:
myfeature_sso.features.defaultconfig.inc
myfeature_sso.info
myfeature_sso.module
The .inc file contains the configuration values I had put in (admin/config/people/simplesamlphp_auth) correctly
Now, in a few places, I want to replace the hard coded values with variables that change based on the environment. I set the variables at the top of .inc file using variable_get $office_ou = variable_get('office_ou', NULL); ...and . A quick example is $base_url below:
$strongarm = new stdClass();
$strongarm->disabled = FALSE;
$strongarm->api_version = 1;
$strongarm->name = 'simplesamlphp_auth_logoutgotourl';
$strongarm->value = $base_url ;
$export['simplesamlphp_auth_logoutgotourl'] = $strongarm;
When I DPM these variables, they display correct values.
But on a fresh install when I enable myfeature_sso module the value of variables are missing.
missing value from $base_url variable
Can you please point me in the right direction?
Thank you.
I found the answer:
when in features ui, do not add fields relevant to simplesamle to the defaultconfig section. if you have any there remove them.
add fields relevant to simplesaml to storongarm section
export the feature
in your_feature_name.strongarm.inc add any additional php code to function your_feature_name_strongarm()
done
Can we write an xlsx file on client side using angular js .If it is possible then please provide me the solution.
You could use a library like angular-xlsx or js-xlsx to help you with this process.
You can export data from AngularJS to XLS, XLSX and CSV formats with Alasql library.
For example we want to write a data which we saved in test variable in an XLSX file through click a button. To do this just use following steps:
1- Include following files in your page:
<script src="http://alasql.org/console/alasql.min.js"></script>
<script src="http://alasql.org/console/xlsx.core.min.js"></script>
2- So Then make a function in controller to save the test variable as a xlsx file:
$scope.test = [{a:2,b:8,c:9},{a:0,b:14,c:12},{a:24,b:35,c:76}];
$scope.saveAsXlsx = function () {
alasql('SELECT * INTO XLSX("output.xlsx",{headers:true}) FROM ?',[$scope.test]);
}
So We save the data which we had in variable test into a file which we named it output.xlsx here.
3- The last part is the easiest part. Run the function on click on a button:
<button ng-click="saveAsXlsx()" >Save as XLSX</button>
Above solution is a js library which can be used with jQuery, js and angularJS. If you are looking for something just made for angular then in addition of this solution, you can use ng-csv library. If you want to just have a spreadsheet you can use ng-csv library too. It is very easy but you can't get XLSX, you will get the spreadsheet file with CSV format.
you can create your excel file.
install npm install excel4node
and then use the basic code
// Require library
var xl = require('excel4node');
// Create a new instance of a Workbook class
var wb = new xl.Workbook();
// Add Worksheets to the workbook
var ws = wb.addWorksheet('Sheet 1');
var ws2 = wb.addWorksheet('Sheet 2');
// Create a reusable style
var style = wb.createStyle({
font: {
color: '#FF0800',
size: 12
},
numberFormat: '$#,##0.00; ($#,##0.00); -'
});
// Set value of cell A1 to 100 as a number type styled with paramaters of style
ws.cell(1,1).number(100).style(style);
// Set value of cell B1 to 300 as a number type styled with paramaters of style
ws.cell(1,2).number(200).style(style);
// Set value of cell C1 to a formula styled with paramaters of style
ws.cell(1,3).formula('A1 + B1').style(style);
// Set value of cell A2 to 'string' styled with paramaters of style
ws.cell(2,1).string('string').style(style);
// Set value of cell A3 to true as a boolean type styled with paramaters of style but with an adjustment to the font size.
ws.cell(3,1).bool(true).style(style).style({font: {size: 14}});
wb.write('Excel.xlsx');
here i have added ref link :https://www.npmjs.com/package/excel4node
There was a nice way of themeing the output of Taxonomy pages in drupal 7 that I stumbled across using the method below
(template.php)
function kestrel_preprocess_page(&$variables)
{
if ( isset($variables['content']['system_main']['term_heading']) )
{
$variables['template_files'][] = 'taxonomy_term';
}//end if
if(isset($variables['page']['content']['system_main']['no_content']))
{
unset($variables['page']['content']['system_main']['no_content']);
}//end if
}//end function
And then create a taxonomy_term.tpl.php file. Nice and simple.
Is there a similarly easy way of being able to create a .tpl file to theme the output of the /sitemap page?
I would like to add a new item to the file picker, but I do not know what to do.
I always see a directory portal\0\
How can I change or add path in filepickeruploader ?
<dnn:filepicker id="filepicker1" runat="server"></dnn:filepicker>
DnnFilePickerUploader filepicker = (DotNetNuke.Web.UI.WebControls.DnnFilePickerUploader)Panel1.FindControl("filepicker1");
You can change the path by using the FilePath property.
For example, if you wanted to set the default folder to be "Images/", try this:
<dnn:FilePicker id="filepicker1" runat="server" FilePath="Images/"></dnn:FilePicker>
Use the DotNetNuke.Services.FileSystem namespace. To add a new folder would be:
FolderManager.Instance.AddFolder(PortalId, myPath);
I have the file "license.txt" in the root directory of my project. In the jar-task, I want to add this file to the (root folder of the) JAR file.
I tried
jar {
from '.' include 'license.txt'
}
but this replaces the other content (.class files) instead of adding a file.
And I do not want to add the license.txt to the resources folder, because I do not want to change my project structure just because of the build tool.
Who can help? Thank you!
To add a single file, you can simply do:
jar {
from "license.txt"
}
Your solution should also work if you scoped your include to your from by enclosing it in curly braces.
If you would like to add multiple files, you can do:
jar{
from{
["aaa.txt","bbb.txt"]
}
}
You would add multiple files to output jar as under:
jar {
// Update jar name according to Ascertia conventions
/**
* archiveFileName
* The archive name. If the name has not been explicitly set, the pattern for the name is:
* [archiveBaseName]-[archiveAppendix]-[archiveVersion]-[archiveClassifier].[archiveExtension]
*/
archiveFileName = 'database_postgresql.jar'
from(['build/classes/java/main','mappings/postgresql'])
}
All contents in below directories will be added:
build/classes/java
/main/mappings/postgresql