When creating custom content editor (Editor tab) in sitecore, what the format of URL should be if I have desired aspx page in another VS project - url

When creating custom item editor in Sitecore(Editor tab), only required field is the Url, which will point to the .aspx page. Where this .aspx page should be added and what URL should I type. I've created a web application in Visual Studio and an aspx page with the desired functionality in it. This web application isn't related with my sitecore project. How to specify the URL to this page. Or should I add this page somewhere to sitecore project? Thanks in advance.

Go to core database, then in content editor go to /sitecore/content/Applications/Content Editor/Editors item. Create new folder item here if you like and inside create new item with this template: /sitecore/templates/Sitecore Client/Content editor/Editor (you can copy any existing editor item into your folder). You can set header, icon and Url (any url, absolute e.g. http://stackoverflow.com or relative e.g. /sitecore/shell/Applications/Media/Media Folder.aspx).
Now go to master database and set this editor in Editors field (inside template or specific content item)
I think you should move your Page.aspx inside sitecore project (in layout folder or custom one)
then url should be /layouts/Page.aspx

Related

MVC .NET Core 2.0 - _Layout static files do not load for action methods of a controller

I started a new project in VS 2017 and created a ASP.NET Core 2.0 web application (Model View Controller). Then I've changed the conent of the _Layout.cshtml to the interface I want to use (included #Renderbody etc.) and included all the static content it requires in the wwwroot and save and Ctrl+F5 and the layout shows with all the correct formatting and functionality. No problem so far:
However from this point forward none of the static content files of the _Layout shows in any other view. So for example if I visit any of the following URLS:
http://localhost:52786/home/
http://localhost:52786/home/index
http://localhost:52786/home/about
http://localhost:52786/home/contact
I see this:
Startup.cs already has app.UseStaticFiles() in Configure()
So it sounds like you may have your HTML body content in the wrong place. With ASP.NET MVC &ASP.NET Core MVC, the HTML for each page is served up from the /Views directory (by the Home controller by default), not from the /wwwroot, and it is C# HTML (.cshtml) just like the _Layout.cshtml file. Things like images, static javascript etc. are what's typically located in the /wwwroot directory as these are the parts of your website that are client side instead of server-side.
Try replicating your index, about and contact HTML content as .cshtml files under the /Views/Home directory, replacing whatever's there in the template, except for #{ViewData["Title"] = "Home";} located at the top. The layout template should then serve these as the body content (where #renderbody... is in _Layout.cshtml).
If this still doesn't work I'll need a bit more info about what you've changed from the default template. Hope this helps!
Thank you James for your response. I figured it out and it's actually a noob mistake which I'm posting so that other new developers don't get caught in it.
When you want to reference the content in the wwwroot folder if you reference them without "~/" before the name of the directory it works for the _Layout page which fooled me to think it should work for other parts of the application but you should include "~/" before the folder names explicitly otherwise the static files will be un reachable.

Umbraco: creating user control

I'm new to Umbraco. Currently is using v7.1.4.
I know that MVC partial views can be created under Settings > Partial Views.
If I have switch the rendering engine from MVC to webforms, where should I create .Net user control?
Just to add to CMayers answer, i generally prefer to create a separate project called usercontrols (just for the sake of knowing what it is) and then using xcopy in the build event copy the dll to the bin folder of the umbraco installation. Likewise the ascx pages are copied into the UserControls folder of the umbraco installation.
Then from the umbraco backend in the developer section, you can create the macro and associate the relevant ascx page to it.
All your .NET Usercontrols should be created in the 'UserControls' folder that comes with the default Umbraco installation.
If you don't copy them to here, then you wont be able to access your user controls from the Macro section of the CMS "Choose a file to render".

Fine control over Joomla URLs

I would like to convert my existing website to Joomla. However, I need finer control over URLs than I seem to be able to control with Joomla. Assuming that Joomla is installed in the base public_html directory of my user, I would like these pages to keep their URLs:
http://dotancohen.com/howto/rtl_right_to_left.html
http://dotancohen.com/eng/genealogy.php
http://dotancohen.com/heb/contact_info.html
I am aware that I could use a 301 redirect via .htaccess however I would prefer to actually configure the canonical URL of the page. Is this possible in Joomla or with an extension?
Unquestionably, the defacto standard extension is At http://extensions.joomla.org/extensions/site-management/sef/10134. It's highly configurable, well supported, and ver well rated.
In Joomla! 2.5 you can use the built-in Redirect component to catch old URLs and send them to the right content without fiddling with the .htaccess.
You can also create menu's and menu items that will match the old paths then all you need is to place the content of your .html files into suitable articles. Remember you can create a menu (and thus a path to the content) but not display the menu anywhere on the site.
The genealogy.php appears to be a separate application so you can approach that by doing two things, first have a /eng/ directory on your new website with the genealogy.php application in it that way it will have the same URL. Then if you want to create a menu item in a Joomla! menu then you can link to it using a menu item of type 'External Link' - you can read more about the menu types by clicking on the help button in the toolbar.
[EDIT]
For external pages if you want to wrap the external application in your template use a menu item type of Iframe Wrapper this will place them in the main component area of the template. With a good Joomla! 2.5 template you can use a template style specific (i.e. layout settings) for that page.

Using Application Pages for List Forms

I'd like to use an application page that I created in the _layouts folder as the new document form for a document library in SharePoint.
When I attempt to do this in SharePoint Designer, I have to browse to the file but it doesn't let me browse to the _layouts folder.
This functionality will be list specific so is there a way to make this connection on a per-list basis? My only idea right now is to use a redirect page.

ASP.NET MVC ContentPlaceHolders out of order?

I added a new ContentPlaceHolder (HeadContent) right below the Title so that I can add page-specific css and js files. But when I create a new View using the master page, it puts the default text of the page layout to have the HeadContent open/close tags at the end of the page. Unfortunately, I visually just see it as the first, second and third tags and start typing in my page's html into the last tag. But this isn't the BodyContent place holder because it is the second one. I have to go back and copy/paste them into the correct place. Ugh. Just for kicks, I scrambled all the tags around in the master page just to see what would happen in the view. Sure enough, VS.NET ignores their order in the master page and reorders them the same way everytime.
Why isn't VS just ordering the place holder tags in the same order as in my master page? Actually, how do I make it stop and just do it in the order I have in my master page?
What visual studio is doing (I assume) is loading the MVC View Content Template. I assume the reason all the contents are out of order from your master page is that Visual Studio Extensiblity loads the template then adds any ContentPlaceHolders that are not in the template after the template data.
You can see what the templates look like by going to your Visual Studio file in your Program files then goto Common7\IDE\ItemTemplates\CSharp\Web\MVC2.
There is also a folder for VB. In any case you can open the zip files located in that directory and drill down till you get to the .aspx page and you'll see what VS is inserting into your project when you do a Add New/View.

Resources