How to map shared Content Blocks to Templated in Sitefinity 5.2? - sitefinity-5

I just Migrated my 3.7 website to 5.2 Website, but I noticed that the Generic Content in 3.7 Project have been converted to Shared Content blocks in 5.2. And most importantly not all (only few are likned to pages, i.e., Used in pages column has "Not used" value).
I searched a lot but couldn't find any way to map these blocks to the pages as they were in 3.7 Project.
However, I was trying to follow tutorial:
http://www.sitefinity.com/documentation/documentationarticles/user-guide/widgets/content-widgets-group/configuring-the-content-block-widget
But I didn't see any option such as "Select from existing shared content button" in Edit Template mode, I get this option in Edit page mode & when I set the Content by selecting the existing Content it's not displayed in View mode, but it's displayed in edit mode.
Any ideas how to do this?
Thanks

With the introduction of Sitefinity v4, shared content is no longer available for templates, just for pages. They removed that ability unfortunately due to architectual reasons and performance issues.
The official comment on how to solve it at the moment, is by using inherited templates, where you drop a normal content block on a 'parent' template and thus its child templates inherit it while keeping a single point of edit.
As a non-recommendation 'hack', you can activate it, as described here. But keep in mind the response from Telerik:
it will lead to performance problems. This is why this feature is
disabled by default, and we do not recommend using it.
But there is also good news when you read the Sitefinity 5.3 roadmap which is scheduled for release end december 2012:
The 5.3 release includes the below improvements:
Shared content is now available to use inside page templates
Hope this helps,
Jochem.

Related

Replace MVC Application Part and Razor File Providers in runtime

I have a WebAPI/MVC app which loads separate plugin assemblies with embedded controllers and views and puts them into the MVC PartManager. This works fine but now I'd like to be able to swap these parts out in runtime without restarting the server. I can use PartManager.Remove on the old part and Add with a new part, but this does not seem to be enough. When calling the controller I still get a response from the old controller in the old part.
Apart from adding parts in the PartManager I also add a EmbeddedFileProvider into the RazorViewEngineOptions on Configure because just adding an AssemblyPart does not seem to be enough for the Razor engine to find the view (not sure I'm doing this right). But I don't know if I can replace this Razor-fileprovider in runtime? I have not found a way.
Anyway, what is the preferred way of doing all this, I mean loading/replacing dlls with controllers, views and static resources. Am I on the right track even?
i think that Razor view engines are configured once only, so you cannot change them later.
What you can do is to
have multiple view engines running,
choose between them based on the URL (as in your case - you want to use a different engine for the one controller).
This is described in CUSTOMMOBILEVIEWENGINE section of Scott Hanselsman's blog post. What he was doing was to use different view engines for different devices, but you can adapt the technique for your own purposes.

Using XDK, how do I link to another page? Hyperlinks are disabled

Edit: so apparently adding class="button" make it work... Can someone provide a reference on what other classes are there? We can't find any information on this.. Thanks
We are making an app in HTML5 using XDK, it has quite a few different views. We were planning to just link to another html page each time we want to go to a different view. But we quickly found out that hyperlinking does not work, is disabled, and button does not link either.
One of the people in my group said she saw an example about having a bunch of and then just show and hide them and use that as UI navigation... is that the only way?
Thanks in advance!
The Intel XDK doesn't insert any class definitions or require that you use a specific framework. It is a tool for assembling an HTML5 hybrid mobile app using the CSS, HTML and JS files that you supply.
If you look at the samples and the default "blank" project that is created when you create a new project you'll see that there may be references to one or more of the following "phantom" JS files:
intelxdk.js
cordova.js
xhr.js
The first two (intelxdk.js and cordova.js) are special "device API" JavaScript libraries. You won't actually find them in your project directory, they are automatically included when you use the emulator and when you build your project (which "wraps up" your HTML5 code and assets into a native wrapper that is specific to the target you are building -- it does not compile anything, it just converts it into a hybrid native/HTML5 container app that can be installed on the target platform that you built for).
The third one is a special helper JS library for dealing with CORS issues from within your app.
None of these three JS files define any classes or HTML tags, etc. They simply implement target-specific device APIs that consist of JavaScript on the "top end" and native code on the "bottom end." Your application only sees and interacts with the JavaScript interface, and only with the APIs that you need to use (which is totally optional).
For an intro to all of this, please see the Intel XDK Documentation page.
So, that means you determine which frameworks and structure your app takes. In other words, if you want to use Bootstrap and jQuery you can do so. If you decide to use the App Designer or the App Starter tools, they will define some classes that impact your layout. However, you are not required to use these tools to define your HTML and CSS, you can do it by hand or use your favorite UI framework library.
Keep in mind that your code is not being rendered by a desktop browser but the embedded "webview" that is part of the device. These webviews don't have the same memory and CPU resources that you're used to working with in a desktop browser, so you need to learn to be "lean and mean" for the best results. You are using HTML5 technologies to build a mobile app -- not creating a web site on a phone.
Hope this helps, please see our HTML5 web site for more background material. It's a little slim right now, but we're adding examples and background material as time and resources permit.
Hope that helps...

Umbraco MVC: Repeating same pattern content

I am new to Umbraco Mvc. A page consists of repeating content -heading and body text. User can be able to add or remove any number of such type of content panel.
How can i implement this?
For this page i added a document type, template and content. I am not sure what to do next?
Please help,
Thanks.
This is an old question but I thought I'd leave a note here.
Umbraco 7
Both Nested Content and Archetype are both great packages for creating repeating content on a page/node in Umbraco. Nested Content is actually so good, as of version 7.7.0, it is included in Umbraco!
Another way to create repeating content is to create the content as nodes/pages in Umbraco, then picking it (using a multinode picker) node/page where you want the data to show.
Umbraco 6
Checkout uComponents as it allows for repeating content too.
Self promotion
My old blog post The best Umbraco packages of 2017 contains a little more information about these specific packages.

What are the steps for converting the view engine for an MVC project from .ASPX to Razor?

I've inherited an MVC3 project that has a large number of ASPX views that I would like to convert to Razor. This question => Aspx to Razor syntax converter? is similar to mine, and it helped me find a bunch of options for converting the views themselves, but I'm unclear on the steps I need to take in addition to converting the views.
The first known limitation of Telerik's razor-converter is "The tool only works with views and does not deal with the project structure and master pages". This tool claims to be able to convert master pages as well, but it doesn't look like anybody beyond the developer has ever used it.
I think these are the steps I need to take:
Use a utility to convert the views
Convert the master pages manually (how do I do this?)
Modify the project structure (what needs to be modified?)
Delete the ASPX files
Test the application (any specific gotchas I should look out for?)
Are these the right steps? Can you help me with my questions on steps 2 and 3?
I have only tried this on one solution and the actual conversion did a fairly good job. I downloaded the Telerik converter project, compiled it, and then converted my projects using these command lines:
aspx2razor C:\Development\MyProject\MyWebProject\*.ascx C:\Development\MyProject\MyWebProject -r
aspx2razor C:\Development\MyProject\MyWebProject\*.aspx C:\Development\MyProject\MyWebProject -r
aspx2razor C:\Development\MyProject\MyWebProject\*.master C:\Development\MyProject\MyWebProject -r
I only needed to go back to add an #include for a namespace here and there, and to add a few parenthesis to force the Razor view engine to recognize my inline code properly. This was also a fairly simple solution, so YMMV. But even if it converted 80-90% of your views successfully, it's that much less manual work which you would have to perform yourself. From here, you could also create a _ViewStart.cshtml file and make a few minor adjustments to take advantage of Razor-specific layout features. (Check out Scott Gu's post on it here: http://weblogs.asp.net/scottgu/archive/2010/10/22/asp-net-mvc-3-layouts.aspx)
The big issue I had was trying to reconcile the file changes with source control. Since the classic MVC view engine uses .aspx, .ascx, and .master extensions, I had to manually add the .cshtml files to my MVC web project and source control then remove the old versions. It wasn't difficult, just time-consuming.
In addition, you may need to add all of the necessary web.config entries to support the Razor view engine as well if your project was created using MVC 1 or 2. Projects created with MVC 3 should already have these entries in place, even if it was not originally created as a Razor site.

Sitefinity 4 - MasterPages

I am running the trial version of Sitefinity 4 RTM.
The great thing about Sitefinity 3.x was that I could port my masterpages from an existing site and they would just work with Sitefinity: Sitefinity did not inject stuff into the pages, or the content blocks.
However, Sitefinity 4 seems to be injecting its own stuff (styles, etc) into the page that screw up my layouts.
Also, for example the Sitefinity ContentBlocks wrap their content in a tag.
Is there a way to stop this happening or would I have to rewrite my master pages and style sheets if using Sitefinity 4?
Other issues, eg, setting up a new site are great, but the above is a bit of a killer.
First, you'll probably want to post this to the Sitefinity forums. You'll get a lot more attention there.
--
However, here are a few thoughts:
Check out the Design and Skin settings for Sitefinity Widgets. By default, Sitefinity Widgets get associated with a Sitefinity Skin and some embedded stylesheets. By switching to a custom skin, you can define your own CSS.
Feel free to modify the templates being used by Sitefinity widgets. You can define your own HTML.
I'm doing a webinar next week (Real World Project Development with Sitefinity 4.0) that will touch on some of these things. For those visiting here later, the video can be found on Telerik.TV.
Good luck.
Once you integrate master page from an existing site, no need to add attribute block in the child page, provide only the body part. sitefinity by default generates attribute.
Here is a link for documentation on how to use custom CSS. Hope this will be helpful:
https://docs.sitefinity.com/custom-themes-and-templates-create-the-css-of-the-theme

Resources