w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Umbraco: What can I do to fix my stream content with Multiple Node Tree Picker?
try this ..... <xsl:param name="currentPage"/> <xsl:template match="/"> <xsl:if test="count($currentPage/articlePicker/MultiNodePicker/nodeId) &gt; 0"> <xsl:for-each select="$currentPage/articlePicker/MultiNodePicker/nodeId"> <xsl:variable name="node" select="umbraco.library:GetXmlNodeById(current())" /> <a href="{umbraco.library:NiceUrl($node)}"> <xsl:value-of select="$node/@nodeName" /> </a> </xsl:for-each> </xsl:if> </xsl:template> </xsl:stylesheet>

Categories : Dotnet

Custom App.config section causing configuration load error
The configSections element must be the first child of the configuration element. Try this: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="ErrorEmailer" type="EmailTester.ErrorEmailer" /> </configSections> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <ErrorEmailer> <SmtpServer address="mail.smtphost.com" /> <FromAddress address="from@host.com" /> <ErrorRecipients> <ErrorRecipient address="example@example.com" /> <ErrorRecipient address="example@example.com" /> </ErrorRecipients> </ErrorEmailer> </configuration> Furthermore, you need to put the namespa

Categories : C#

Strange behaviour of Umbraco media folder
There are no issues I know of with Umbraco 4.7.x deleting its own media. It is possible to do it remotely, but that would delete the nodes as well as the physical files. The only cause is the one which seems most unlikely, and that is someone has accidentally deleted them. I find this occasionally happens when deploys are done. Someone replaces the media folder with the one from the staging environment. I have also seen an issue if files are copied across an RDP connection, the files being copied are not copied completely and in the process some actually disappear from the target folder. But either way, I would check your internal processes, maybe move the media folder to a virtual directory to avoid the chances of it being overwritten.

Categories : Asp Net

Editing Media Properties programmatically in Umbraco (4.11)
you should be able to exactly what you've already done but replace the line: Document doc = new Document(mediaItemId); with Media doc = new Media(mediaItemId); You will of course have to make sure that your Media type has a "likes" property. This can be done in the "Settings > Media types" section of Umbraco in the same way that you can add properties to document types.

Categories : C#

Magento Admin section - Rewrite custom options in products edit displays blank content
Found out the issue It was the space between the <catalog_product_edit_tab_options> tag which was creating the problem. I changed <catalog_product_edit_tab_options> Mymodule_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option </catalog_product_edit_tab_options> to <catalog_product_edit_tab_options>Mymodule_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option</catalog_product_edit_tab_options> in the config.xml. An error if displayed would have saved me lots of time.

Categories : PHP

Clicking a custom UITableView section header is invoking didSelectRow: on first row of the section
You can do it through setEnableUserInteraction method. Pls refer the code given, - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; [cell setUserInteractionEnabled:YES]; if([indexPath row] == 0) [cell setUserInteractionEnabled:NO]; return cell; } Hope this will help you :)

Categories : IOS

Why is the cancel button in my media picker not working?
I wonder if you need to do: - (void) mediaPickerDidCancel: (MPMediaPickerController *) mediaPicker { [mediaPicker dismissViewControllerAnimated:YES completion:nil]; } instead? Also, set a break point within your "mediaPickerDidCancel" method and just see it the breakpoint even hits when hitting the cancel button in the picker.

Categories : IOS

UIPickerView change content text size after loading content into picker
If I understood your question correctly, you may want to take a look at this answer. The strategy is basically to truncate (ellipsis) instead of font shrinking. Edit (based on comment) I would strongly advise against setting all text to the minimum font. Lets say you have elements as such: Pear Peach ok, so far these will fit your label perfectly, with a good font size. Now you add a longer item: Pear Peach Strawberry Pineapple and now all your items are a little bit smaller, but thats still readable, so it's acceptable. And then a huge item appears, such as: Pear Peach Strawberry Pineapple SomeKindOfExoticFruitThatHasAnIncredibleLongName which would make all items inside your picker become incredibly small, and difficult to read. But if you still want to go down that roa

Categories : IOS

Umbraco Editable Content Block
This is possible, I have created similar blocks in the past with XSLT, but of course it can be done with WebControls or MVC as well. First, on the DocumentTypes where you want to display the static content block, add a new field called StaticBlocks. The type could be a multilist or dropdown or so, whatever you prefer as long as you can choose at least one (ContentBlock) item from the content-tree. You need to create a new Document type, call it ContentBLock and add a RichText field to it. This is your static content block. Also create a template for this ContentBlock and make sure the template is rendered somewhere in your main layout. This template only contains a Macro (in my case it was an XSLT macro). The XSLT Macro reads the selected nodeID from the StaticBlocks field from your cu

Categories : Dotnet

rendering html content from umbraco
The information that you receive from your program is in the JSON format whereas with Firefox you are receiving it in the XML format. If you read the documentation on umbraco, which I have not used, there is most likely a parameter you can add to the GET URL to ask for either JSON or XML.

Categories : C#

Umbraco hook up to load document
One way to do it would to have a separate db table specifically for page hits, e.g. [PageHit] which had two columns [NodeId] and [HitCount]. A hit on a page either created a new record if no hits had previously been recorded, or incremented the count on an existing record. You would need to ensure that the hit was recorded per page, so recording it in the your base Masterpage or in a base Controller would be my approach. You could then have a property based upon a custom datatype that looked up the hit count for the specific node that the property existed upon. The custom datatype could be a usercontrol, and since in the Umbraco backoffice when you load a node in the content editor the node's ID is in the query of the URL, you can access this in the usercontrol to query the database. U

Categories : C#

Retrieve html content via examine umbraco
Examine removes all HTML elements, so all that is stored is content ( all tags are stripped for indexing ). You cannot do what you want to do with Examine. If you need the HTML from the node, you need to use the Umbraco API.

Categories : C#

Displaying a content managed image in a Umbraco 6 MVC website
Two things here: You don't need to cast the property value to an Int32, as TypeMedia() accepts a string or object id parameter. You can use the Url property of the IPublishedContent instead of GetPropertyValue("umbracoFile") So it becomes: <img src="@Umbraco.TypedMedia(Model.Content.GetPropertyValue("siteLogo")).Url"/> Which is much nicer isn't it? There are obviously many ways to shortne this, extension methods but one that a friend showed me recently was uMapper which allows you to create strongly typed objects corresponding to your document types, working much like AutoMapper. For a little leg work up front, your code can become much more understandable and concise.

Categories : C#

How should a NAS based Load Balanced Environment be configured in Umbraco?
The whole point of using NAS is so that you don't necessarily need virtual directories. There is one shared file repository for all instances of the CMS. Because everything is stored in one place you don't need file replication either but you do have to ensure that the backoffice has sole access to it. The exception is umbraco.config. This file needs to be present per instance and so you have to set umbracoContentXMLUseLocalTemp = true. This allows the umbraco.config file to be created in the HttpRuntime.CodegenDir directory (the directory where ASP.NET stores temporary files). If you are noticing a substantial difference in performance between this and using a virtual directory instead, it is possibly because you don't have write permissions to the HttpRuntime.CodegenDir directory (so w

Categories : Iis

Display Media Library Picker Field image in a lists alternate item view in Orchard CMS
bah - so once again this all comes down to the Placement.info file in my theme. I added a reference to the Fields_MediaLibraryPicker inside my DisplayType="Summary" and it worked like a charm. E.G My placement.info in my theme has this for an item in my list <Match DisplayType="Summary"> <Place Parts_Common_Metadata_Summary="-"/> <Place Parts_Title="-"/> <Place Fields_MediaLibraryPicker="Content:1" /> <!-- this adds the field.. --> </Match>

Categories : Asp Net Mvc

How to implement custom controllers in Umbraco 6
Do you really mean you want a custom controller, or do you actually just want to create a form in Umbraco using MVC? If it's the latter then you need to use a surface controller ie. ensure your controller inherits from Umbraco.Web.Mvc.SurfaceController and has the suffix 'SurfaceController'. public class MySurfaceController : Umbraco.Web.Mvc.SurfaceController { public ActionResult Index() { return Content("hello world"); } } You then need to use the custom Umbraco Html helper to create your form tags: @using(Html.BeginUmbracoForm("CreateComment", "BlogPostSurface")) { // } See http://our.umbraco.org/documentation/Reference/Mvc/forms

Categories : C#

In Umbraco 6.1.1 MVC 4, how can I do a form post back to a surface controller using a model that inherits from Umbraco's RenderModel?
Ok, I've had no responses to this question but am now in a position to answer it myself. Maybe it was a fundamental oversight, but not that obvious imho, and information on the Umbraco forum etc about inheriting from RenderModel is fairly limited. Essentially the answer, as was my first instinct, is to solve the original exception "No parameterless constructor defined for this object" by providing a paramaterless constructor. The difficulty is working out what to put inside the parameterless constructor for my model, since it inherits from the Umbraco RenderModel which requires an IPublishedContent instance passed to it's constructor. Luckily while browsing around I happened across this post on the Umbraco forum: http://our.umbraco.org/forum/developers/api-questions/40754-Getting-Curre

Categories : Asp Net Mvc

Umbraco MVC Implementation - View does not depend on Umbraco implementations
No you can't. Simply because all requests pass through a single action. In order to retrieve a path to a CMS-managed page, you need to use the node/content traversal the @Model provides. See here for more details on this. Edit To clarify, the author of the article is suggesting that the Umbraco implementation should be more in line with a traditional MVC implementation with little or no logic in the views. Therefore, any querying of node data should happen prior to the view (e.g. in the Mappers). So this is where you would have to retrieve the links. Umbraco's default MVC implementation forces all requests to go via a single action on a single controller. The author's implementation allows the requests to be shared across one controller per document type - which is better IMO. But it st

Categories : Asp Net Mvc

Load Social Media Script after Ajax Load
Very first thing you are using very old version of jQuery and live is deprecated tag in newer version. Second you need to modify the code as below where you need to trigger event attach to body not to news_sharesocial $(document).ready(function(){ $("body").live("runScripts", function(){ $(init); function init() { $.get('news-sharesocial.html', inject); } function inject(data) { debugger; $('.news_sharesocial').html(data); //$('body').html(data); //document.write(data); } }); $("body").trigger("runScripts"); }); As you have attached the event to body so it will be triggered from same element.

Categories : PHP

Umbraco MediaService / Umbraco MediaItem not saving
To Save media, I found this method with MediaService. However, I think it's possible another method more refined [HttpPost] public JsonResult Upload(HttpPostedFileBase file) { IMedia mimage; // Create the media item mimage = _mediaService.CreateMedia(file.FileName, <parentId>, Constants.Conventions.MediaTypes.Image); mimage.SetValue(Constants.Conventions.Media.File, file); _mediaService.Save(mimage); return Json(new { success = true}); }

Categories : C#

Umbraco - error when using umbraco.library:NiceUrl(...)
Ok I found a solution: I added an extra check to this part: <!-- Return the url --> <xsl:if test="$i = $max"> <xsl:if test="$id != '' "> <xsl:value-of select="umbraco.library:NiceUrl($id)" /> </xsl:if> </xsl:if> this fixed my problem.

Categories : Xslt

Preferred method of adding records to custom tables in Umbraco?
There are two answers to this question: Use a framework/solution like EF; Use Contour If you haven't looked at it, Contour is an Umbraco plugin that does exactly what you need. See here for more information about Contour. However, for more control I use PetaPoco or more recently NPoco (via NuGet) and also Autofac to inject the Database (analogous to DataContext) into the constructor of my Controllers. This is super easy and if you aren't already using an IoC container like Autofac in your builds I would highly recommend looking into it. Especially if you stick with EF, as you could ensure that a single DataContext object was created and disposed for each request, making sure that you didn't have multiple contexts floating about.

Categories : Asp Net Mvc

Set picker view to value on load
You can use this instance method: - (void)selectRow:(NSInteger)row inComponent:(NSInteger)component animated:(BOOL)animated; UIPickerView Documentation In your case it will be something like this: - (void)viewDidLoad { [super viewDidLoad]; [myPickerView selectRow:3 inComponent:0 animated:NO]; }

Categories : IOS

HTTP GET to return custom model with data from external database with Umbraco MVC Surface Controller
There are a lot of questions about this and the best place to look for an authoritative approach is the Umbraco MVC documentation. However, yes you will find, if you use Html.BeginUmbracoForm(...) you will be forced into a HttpPost action. With this kind of functionality (a search form), I usually build the form manually with a GET method and have it submit a querystring to a specific node URL. <form action="@Model.Content.Url"> ... </form> On that page I include an @Html.Action("SearchResults", "TyresSearch") which itself has a model that maps to the keys in the querystring: [ChildAction] public ActionResult(TyreSearchModel model){ // Find results TyreSearchResultModel results = new Wheels.BDL.TyreBDL().GetAllTyres(); // Filter results based on submitted mo

Categories : Asp Net Mvc

Could not locate Razor Host Factory type: umbraco.MacroEngines.RazorUmbracoFactory, umbraco.MacroEngines
If you are trying to host the blogengine site within a virtual directory of the Umbraco site, then you will have to amend the blogengine web.config to "remove" all the Umbraco-specific handlers and modules, as these will be inherited by the blogengine application, causing this exception because the application can't find the relevant DLLs in its bin folder. I recently had a similar problem and I have posted the web.config I used in the virtual directory below. Mine was a very simple web application, so obviously this will not work by itself in your blogengine app. You will need to add the relevant parts into your web.config file. Also, this was for a v6 Umbraco install in IIS7.5, so you may have to experiment a little. <?xml version="1.0"?> <configuration> <configSecti

Categories : Iis

Adding a date range picker with jQuery and updating content
You can use start date and end date in http://www.eyecon.ro/bootstrap-datepicker/ Or can play around in http://jqueryui.com/datepicker/ for max and min of date range http://jqueryui.com/datepicker/#date-range

Categories : Javascript

Custom Picker View for iOS 6.1
In the future, please make an effort to format your code properly. Doing so makes it easier for us to help you. Anyway, you're only setting the label's text when you're first creating the label. In the case when you're reusing a label, you just return the reused label unchanged. - (UIView *)pickerView:(UIPickerView *)picker viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { UILabel* retval = (id)view; if (!retval){ retval= [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [picker rowSizeForComponent:component].width, [picker rowSizeForComponent:component].height)]; retval.font = [UIFont fontWithName:@"Helvetica" size:48]; retval.backgroundColor =[UIColor clearColor]; retval.textAlignment = NSTextAlignmen

Categories : Misc

Custom picker dialog
You should take a look to the official guide for Dialogs usage in Android: http://developer.android.com/guide/topics/ui/dialogs.html And more specifically for pickers : http://developer.android.com/guide/topics/ui/controls/pickers.html For a number picker if your target is > to API 11: you can use the existing Android widget NumberPicker-> http://developer.android.com/reference/android/widget/NumberPicker.html Use this widget in a custom dialog box and it's done.

Categories : Android

Custom Date Picker Dialog
After Brain Storming half a day i have found this solution this may help other having such scenarios My Custom class for date Picker is Following that will update the date in title every time user change month/year class CustomDatePickerDialog extends DatePickerDialog implements OnDateChangedListener { private DatePickerDialog mDatePicker; @SuppressLint("NewApi") public CustomDatePickerDialog(Context context,int theme, OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth) { super(context, theme,callBack, year, monthOfYear, dayOfMonth); mDatePicker = new DatePickerDialog(context,theme,callBack, year, monthOfYear, dayOfMonth); mDatePicker.getDatePicker().init(2013, 7, 16, this); updateTitle(year, monthOfYear); } public void onDateChanged(Date

Categories : Android

Styling custom date picker
Without being able to see the markup or css, my first inclination with these is to add a CSS triangle either to the element, or to the elements :before pseudo class. As for making the CSS triangle, go here: http://apps.eky.hk/css-triangle-generator/

Categories : Javascript

How to use Custom Picker View with search bar in ios
Errors like this can be caused by non properly retaining objects: The object is released and freed. Its memory is reused for some random other object. Then, when a selector is called on the original object -> boom. One thing to check is if all your @properties that hold objects in your class are strong and not assign. What's also smart to do is setting an exception breakpoint Finally, try to find out to which object this pointer 0xaad8950 (did) belong(s): Place breakpoints further and further, before the app crashes and look around at the objects' address you're having. Good luck!

Categories : Iphone

How to remove programmatically all the content of a section?
You need to reference Microsoft.Office.Interop.Word With that you can create a new word application. Dim oWordObj as Word.Application = CreateObject("Word.Application") From there you can grab the necessary word document Dim oDoc as Word.Document = //Grab your document here From there, there are many easily searched ways to modify the document. Start looking into this and you should find what you need.

Categories : Vb.Net

Responsive css not working in content section
Your section#content-wrapper gets margin-left and margin-right of 30px upon page load. Either remove jQuery('#content-wrapper').css({ 'margin-left':'30px', 'margin-right':'30px' }); from jquery.custom.js (line 332), or change it to 'margin': '0 auto'

Categories : HTML

AndroidViewClient: content is not allowed in trailing section
Hmm I reset my device to factory settings and suddenly it works ok :o EDIT: I figured out what the issue was. I'm trying to automate the CTS testing and when the Delegating Accessibility Testing Service is enabled, it somehow causes AndroidViewClient to fail after that point in the script and on monkeyrunner executions for other scripts. Turning it off allows any script using AndroidViewClient to behave normally again...

Categories : Android

Make content section stretch down to the footer
With this 'sticky footer' example you're stretching the 'top-wrapper' only. I think in order to adjust the (minimum) height of the 'content' element it has to get calculated via JS. Here is a example with jQuery: http://jsfiddle.net/eBR8e/1/ (function( window, $, undefined ) { var topWrapperHeight = $('.top-wrapper').height(), bottomWrapperHeight = $('.bottom-wrapper').height(), headerHeight = $('.header').outerHeight(), navigationHeight = $('.navigation').outerHeight(), contentHeight; contentHeight = topWrapperHeight - bottomWrapperHeight - ( headerHeight + navigationHeight ); $('.content').css({ 'min-height' : contentHeight }); })( window, jQuery ); It's a pretty straight forward calculation, but let me know if you have any q

Categories : CSS

Section Headers and Row Content ... want them to display at the same time
Your delegate methods need to take into account that data is coming in asynchronously. Lets assume for a moment that your data model consists of an array of sections, with each element in the array being a dictionary containing a title and an array of row data. Your numberOfRowsInSection would look like this: - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [sectionsArray count]; } So when sectionsArray is empty, the table view will know there are zero sections and nothing will be displayed. When your asynchronous data comes in, you populate sectionsArray and then call [tableView reloadData]. numberOfRowsInSection will be called again, this time returning non-zero number of sections and the table will populate itself. All of this is

Categories : IOS

How to grab content from section within blade template
Instead of doing the normal return of view return View::make('page'); You can instead store the view in a string $view = View::make('page'); So then you can do your code something like this (not tested - but you get the idea): $pages = array(...); // content of the directory foreach ($pages as $page) { $renderedPage[] = view::make($page); }

Categories : Laravel

How to animate setValue from NumberPicker? Knowing a Custom Picker which do the same?
I have found a very nice implemtationof a custom number picker which looks grat and do exactly what I want. Nice Custom Picker https://github.com/ai212983/android-spinnerwheel It's based on the android-wheel: https://code.google.com/p/android-wheel/ Special thanks to Dimitri Fedorov ai212983. Great job!

Categories : Performance

How to play an audio from content://Media
If you read Android developer webiste you will have your answer. http://developer.android.com/reference/android/media/MediaPlayer.html

Categories : Android

Retrieving url from feedparser media:content
entry.media_content is a list of entries, each a dictionary: for item in entry.media_content: print item['url'] You could just grab the first one listed: if 'media_content' in entry: mediaContent = entry.media_content[0]['url']

Categories : Python



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.