Quantcast
Channel: DevNet Questions
Viewing all 11888 articles
Browse latest View live

Whitelist admin section of Kentico

$
0
0
I don't like the world seeing the admin interface of my Kentico site. Kentico allows you to create a new folder for admin pages but the existing folder is still there and its pages still accessible. I want to whitelist the admin folder by IP.

Kentico 10 MVC Image resizing

$
0
0
I'm using the new methods available in MVC to reference images in the media library:Url.Kentico().ImageUrl(banner.BackgroundImageMobile.ToLower(), SizeConstraint.MaxWidthOrHeight(768)) The image loads fine but does not resize with the constraint on it. Do I have to add my own logic that resizes images using the query string parameters?

Kentico getresource 404 error css and js

$
0
0
Using Kentico 9, while I was away it appeared that something changed! While our production site appears to be working fine our staging site is not. When I try to access the staging site it is unable to "find" any of the related CSS or JS files and therefore displays the site without any of those files. Another part of the problem is that the same thing is happening in the admin portal and since the admin portal relies on those CSS and JS files to work I can't troubleshoot there. When I try to get to the resource directly in a browser: e.g. iddba-staging.azurewebsites.net/CMSPages/GetResource.ashx?stylesheetfile=/App_Themes/Default/bootstrap.css it fails.When I try to access it directly at the prod site: www.iddba.org/CMSPages/GetResource.ashx?stylesheetfile=/App_Themes/Default/bootstrap.css as I would expect it provides me the opportunity to save the file.Our site(s) are hosted in Azure.Any idea of where to turn next? Thanks. Also on a possibly unrelated note, I have also noticed an error in the logs on staging that is not on prod: .NET Runtime version 4.0.30319.0 - Loading profiler failed. Failed trying to receive from out of process a request to attach a profiler.Not sure if this might be related. Thanks.

Badge Implementation idea

$
0
0
So I am thinking about building a custom badge implementation for a site. I want the badges to be activity specific, such as Creating a Community Group, Liking an Article (likes are stored in a custom table), and wanted to get some feedback if anyone had any ideas on the best way to do this.My original idea was to create it all custom, maybe using scheduled tasks for re-evaluation, utilizing custom events to trigger things. My issue with this approach, is I would most likely have to add code for each badge I created.my new thought is maybe utilizing roles to determine which badge a user receives, and then somehow using the Macro Rules to set the conditions for users to be added to the roles. Thought maybe using the contact groups, or maybe even Workflow? I really like the idea of using the macro rules to manage conditions for the badges, just not sure which direction to go. (this is also assuming you can create custom macro rules, which I believe is possible)Any suggestions?

Continuous Integration Enabled Disabled

$
0
0
Where in the Config Database is the Continous Integration enabled switch stored,i.e. How can we programmatically Turn CI on Also How can we programmatically Rebuild repository........ Serialise objectsMany thanksJon Marshall

Form Controls in Module Package

$
0
0
I have followed the Kentico instructions for creating a Module Package and for the most part this is working fine, although I have an issue with including Form Controls in the package.At present the form controls get included in the Installation Package as they are in '~/CMSFormControls/{ModuleCodeName}/' and the installation package does copy these files accordingly. However, the definition for the Form Control objects is not being exported and hence they do not appear in the database (tried with Kentico 10 Hotfix 7).

Upgrade 8.1 -> 8.2: An item with the same key has already been added.

$
0
0
Currently in the process of upgrading a project from 8.1 -@ 8.2. Each time, I run through the upgrade with no issue, but receive an error when debugging the site. I have tried this with two different sites and have gotten the same result.Has anyone seen this one before and what do you believe that the problem could be?Error: An item with the same key has already been added.

New User Approval via email

$
0
0
Hi there,I want to set up user registrations to a secure area on our site. We want to 'vet' the registrations so need to enable admin approval.I know you can do this and get an email sent to admin to log in to the cms and approve.However, I was hoping to make the process easier and available to people without having to log in to the system and approve.Is there a way for an email to be sent to admin where they just click a link in the email to approve/reject a new user?Thanks in advance, Jon

Kentico 7, How to drill into CMS and get the images in an HTML page

$
0
0
Hi I'm fairly new to Kentico. I need to access the CMS and get images to my html page. how do i do that, have seen methods like getURL, but dont know which context i use them

Kentico 9 ui permissions regarding the media library

$
0
0
is it possible to allow read access only to the media library? I'm setting a role and with the Media Library module, I've only set the Read permission to Allow, but a user with that role still sees the upload button. Am I looking at the wrong module?

Add 'Reset' or 'Clear' Button to form

$
0
0
Is it possible to add a 'Reset Button' or 'Clear Form' button along with a submit button to a form in Kentico7? [screenshot] http://prntscr.com/e38idtWe don't' use the widget but implement through CMS desk @ tools @ forms

Full Image Path in Product Feed?

$
0
0
Good afternoon. This is a simple question that I'm sure has a simple answer that has so far eluded me. I have created an RSS feed of a product catalog with the Products RSS Feed webpart. I'm trying to display a full-path link to the image SKUImagePath. I can get everything but the domain, so it seems.This snippet in the tranformation @image_link@@%# EvalCDATA(@SKUImagePath@) %@@/image_link@outputs this in the RSS feed @image_link@@![CDATA[~/getmetafile/604511c3-7350-47e8-808a-02649df13f41/TS4000_6002_Cropped.aspx]]@@/image_link@The path is correct, but how do I add the domain? Thanks!Kentico 10.0 ASPX templates + portal

Facing an issue with DocumentHelper method in Kentico 10

$
0
0
I am using a csv file and adding all products to the kentico database with the help of DocumentHelper methods.Below is the code which I used while adding products to Kentico database in Kentico 9.0. This works finepublic void InsertAttachment(string url, SKUTreeNode productDoc) { string file = DownloadImage(url); if (!String.IsNullOrEmpty(file)) { Bitmap bmp = (Bitmap)System.Drawing.Image.FromFile(Server.MapPath(file), true); AttachmentInfo attachment = DocumentHelper.AddAttachment(productDoc, "ProductImage", file, tree); attachment.AttachmentImageHeight = getRelativeHeight(bmp); attachment.AttachmentImageWidth = 300; attachment.AttachmentIsUnsorted = true; AttachmentInfoProvider.SetAttachmentInfo(attachment); productDoc.Update(); } } Same code I use for Kentico 10 but I get an error in the AddAttachment method.It is not accepting the TreeProvider variable “tree”. Can you please provide me the solution for this or an alternate way through which I might add an attachment ?

How to disable showing up Editable regions from masterpage in child pages

$
0
0
Hi,I have created master page template in CMS administration with template type as @Portal Page@. In layout I have added editable text in the footer of master page. I have filled up data in those editable region from @Master page's@ Page tab and saved it.Still these editable region keep showing up as Editable in child pages. Is there any way to show these editable regions as normal text in child pages?Thanks in advance. Manmath

kentico error. Source FiftyOne Degrees

$
0
0
I'm trying to export from my dev site, and it's failing. The event log shows me this. Is FiftyOne Degrees one of the sample sites? EventID: 19797 EventType: W EventTime: 2/2/2017 8:57:20 AM Source: FiftyOne Degrees EventCode: MissingDeviceData UserID: 53 UserName: administrator IPAddress: 192.168.10.28 EventDescription: Could not load the devices data package. EventUrl: /admin/cmsadministration.aspx EventMachineName: DEV2-CMSWEB EventUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36 EventUrlReferrer: http://dev.knowledgefirstfinancial.ca/admin/cmsadministration.aspx

Translating Text using Google Translate Service

$
0
0
I have added few cultures in my site so that i can see content of my site in different languages.I am using google translate service for translating text but it is showing me same text for all languages.When i saw event log i found error related to Google Translator i.e. @The remote server returned an error: (403) Forbidden.@ I have followed steps given in kentico 9 documentation (link-https://docs.kentico.com/k9/multilingual-websites/configuring-translation-services/machine-translation-google-translate).Please suggest solution.

Kentico 9 sync Server Service URL case sensitivity

$
0
0
I have a rewrite rule to make the URL all lower case. It ran before anything else. Site would load fine, things were good, but sync was broken. After some trial and errors I figured it was the rewrite rule. I also tried the build in rule for this with IIS and same issues. With that, is it possible to make a change so the path is all lower case? I didn't think this would have been an issue but it seems to be.Here is my rule @rule name="Convert to lower case" stopProcessing="true"@ @match url=".*[A-Z].*" ignoreCase="false" /@ @action type="Redirect" url="{ToLower:{R:0}}" redirectType="Permanent" /@ @/rule@

Images, etc. not using CDN URL after CDN configuration

$
0
0
After configuring Kentico to use an Azure CDN (Verizon), images are still not using the endpoint URL. After setting up the CDN in Azure we then added the different CDN keys to the web config:@add key=@CMSAzurePublicContainer@ value=@true@ /@ @add key=@CMSAzureCDNEndpoint@ value=@https://xxxx.azureedge.net@ /@ @add key=@CMSAzureCDNCacheMinutes@ value=@60@ /@ Is there something else we are missing here? We've tried this both locally and in staging (hosted externally).

Getting the FilterConditions settings via a Custom Macro

$
0
0
Here's the issue. We have a Custom Table Datasource, with a Custom Filter, with a Basic Repeater on a page. By default, when the page loads the Repeater will display all of the information it received from the DataSource. What I would like it to do is on load NOT load/display anything until a Filter (select state, for instance) is applied, which of course is on PostBack. The direction I've been taking has been to create a Custom Macro that can get the ViewState property for the Repeater's FilterCondition (i.e. a boolean that ask is the FilterCondition null or empty) and then apply it to the visible property of the Repeater, but this doesn't seem possible. In a class the Page level element so including the System.Web.UI Namespace doesn't work, thus no access to ViewState. And there doesn't seem to be any other way to get that data.Any suggestions?

Push/Pull data from Google Sheets to Kentico Custom Tables

$
0
0
Hi there, A bit of a @best practices@ sort of question, since things have calmed down a bit and I've managed to deploy my @solution@, thus I can now reflect on how to do it better next time. We had the need to take data that was being managed in a google sheet (GS) (due to the powerful collaborative capabilities, data filtering and formulas, all baked in without us having to build out a web interface for DB based data) and periodically push that over to a Kentico custom table such that it could be spat out by a repeater. It was originally being done by exporting a sheet into a CSV, then manually imported using the Kentico Import Toolkit, however that was horrendously inefficient (man-hours wise). So I looked at a few options, primarily in the three:Push from GS to Kentico's integration busSomehow pull the data from Google sheets (custom data source)Push from GS to Kentico through a custom Web API endpointI decided on the third as the integration bus didn't seem to offer any benefits (that I could see) in this case, and pulling from Google sheets required Oauth2 based authentication (because it is a private sheet) and thus wasn't seemingly feasible. It ended up like this:public IHttpActionResult Post([FromBody]Payload bodyContents) { UserInfo user = null; user = AuthenticationHelper.AuthenticateUser(bodyContents.Credentials.username, bodyContents.Credentials.password, SiteContext.CurrentSiteName); if (user == null) { return Ok(@Username/password don't match@); } //Get the custom table object that holds all the data string customTableClassName = @customtable.***@; DataClassInfo customTable = DataClassInfoProvider.GetDataClassInfo(customTableClassName); //Clear out the current table contents because we will overwrite everything each time //It ends up being more efficient than trying to update each record individually, and is less prone to errors QueryParameters qp = new QueryParameters(@TRUNCATE TABLE customtable_***@, null, QueryTypeEnum.SQLQuery); ConnectionHelper.ExecuteQuery(qp); if (customTable != null @@ bodyContents.DataArray != null) { //Need the headers row to properly bind data to the correct column name List@string@ headersRow = bodyContents.DataArray[0]; int rowLength = headersRow.Count; for (int i = 1; i @ bodyContents.DataArray.Count; i++) { List@string@ currentRow = bodyContents.DataArray[i]; // Creates a new custom table item CustomTableItem newCustomTableItem = CustomTableItem.New(customTableClassName); for(int j = 0; j @ rowLength; j++) { newCustomTableItem.SetValue(headersRow[j], currentRow[j]); } // Save the new custom table record into the database newCustomTableItem.Insert(); } } return Ok(@Successfully updated: @ + bodyContents.DataArray.Count + @rows.@); } } And on the google side, there is a bit of Google Script action:var data = {}; function updateKentico() { //Set up data range var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Export Data'); var startRow = 1; // First row of data to process var numRows = 1000; // Number of rows to process var dataRange = sheet.getRange(startRow, 1, numRows, 5); // Fetch values for each row in the Range. data.DataArray = dataRange.getValues(); //Filter out blank rows for(i = 0; i@data.DataArray.length; i++) { if(data.DataArray[i][0] == @@) { data.DataArray.splice(i, data.DataArray.length-1); break; } } //Set up API call var url = @***@; var payload = JSON.stringify(data); var headers = { @Accept@:@application/json@, @Content-Type@:@application/json@, @Authorization@:@Basic _authcode_@ }; var options = { @method@:@POST@, @headers@: headers, @payload@ : payload }; var response = UrlFetchApp.fetch(url, options); //Alert user of success/failure DisplayResponse(response); } function DisplayResponse(responseJson) { var ui = SpreadsheetApp.getUi(); var response = ui.alert(responseJson); } //Opens the client side HTML dialog box to take the username/password function GetCredentials() { var html = HtmlService.createHtmlOutputFromFile('prompt') .setSandboxMode(HtmlService.SandboxMode.IFRAME); SpreadsheetApp.getUi() .showModalDialog(html, 'Please enter your Kentico login info'); } //Called from the client side to update the credentials to send to Kentico function SetCredentials(username, password) { data.Credentials = {@username@: username, @password@: password}; updateKentico(); } //Create the UI elements for the user function onOpen() { var ui = SpreadsheetApp.getUi(); // Or DocumentApp or FormApp. ui.createMenu('Kentico') .addItem('Publish to live site', 'publishButton') .addToUi(); } //Click handler for the publish to kentico button function publishButton() { GetCredentials(); } What I'm quite interested in, is hearing from people who have a bit more experience with Kentico... in your opinion, what would be the ideal @Kentico@ way to deal with this situation? *NB: plaintext passwords over post is not secure, but when asked the person requesting the feature stated that they wanted it sooner than secure. SHA256 is the hopeful next evolution of the password-sending step :)
Viewing all 11888 articles
Browse latest View live