I am using UmbracoCMS for one of the my project. I want to create 3 pages as following hierarchy.
About US
Key People
Matt Krikman
AboutUS is parent node for KeyPeople and Profile Page is child of KeyPeople.
So I am expecting following url for each page
About US -> www.mydomain.com/aboutus
KeyPeople -> www.mydomain.com/aboutus/KeyPeople
PeopleProfile -> www.mydomain.com/aboutus/KeyPeople/RyanPinkard
But When I check for KeyPeople and RyanPinkard, I am getting following URL in backoffice:
By default Umbraco does not include top level nodes in the URL because it expects them to be the root of your website. To include them in the URL go to your web config and update the umbracoHideTopLevelNodeFromPath app setting:
<add key="umbracoHideTopLevelNodeFromPath" value="false" />
Alternatively you could move Contact and AboutUs so that they sit beneath Home. This would give you the expected page URLs.
Related
This is my first time round using Umbraco and I have created Document Types / Pages using the wrong naming format and now this has transpired into my page URL's, for instance /about-page/. How would I go about changing them to /about as I have searched the back-end admin panel and there dose't seem to be an option to change their link to document values.
Would anyone be able to provide a simple code based example using umbracoUrlAlias or umbracoUrlName how I could change this preferably in Razor.
Thanks
Editing #run yards Solution by digbyswift help in comment
Correct Solution:
Create Property on in Document Types which applies to all pages you want to change the URL
Call the name anything you want e.g Page URL and Possibly give it a new tab.
Call the alias umbracoUrlName
Type as text sting
Should not be Mandatory (As when you start replacing .Url with .umbracoUrlAlias within the views it will need to be present)
Tab as Generic
Click Save on top right on the page
Added screenshot for starter kit on Umbraco v7.2.5
Unless I'm very much misunderstanding your issue, you should just be able to change the name of your page and republish. This doesn't need an additional field, just change the value in the "Properties" tab and republish the page. This will automatically change the URL of the page.
You can also create a property called umbracoUrlName using a TextString property editor. If this has a value then it will generate the URL fragment for the page using this value, rather than the page name. This changes the URL for the page, rather than creating an alias, like umbracoUrlAlias.
Solution:
Create property on in Document Types which applies to all pages you want to change the URL
Call the name anything you want e.g Page URL and Possibly give it a new tab.
Call the alias umbracoUrlAlias
Type as text sting
Make it required (As when you start replacing .Url with .umbracoUrlAlias within the views it will need to be present)
Go into all your pages and rename them using the property you just created
Now with your code, say with the navigation where you have used .Url change it to .umbracoUrlAlias and the new URL's will be used.
Note if you don't use .umbracoUrlAlias the links will still be active i.e. they work but they won't be displayed in the address bar as .Url spits out the original ones associated with the page.
You can apply on URL names in web.config:
In section find:
<add key="umbracoUseDirectoryUrls" value="false" />
this will set url names for new created items to name.aspx
If you set this to 'true' then new items will be named like /name/
Additionaly you might want to avoid of Handling some urls by Umbraco pipline, just use this setting - add URLs which must be bypassed:
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd" />
I think my question may be worded incorrectly but heres what I want to do (for SEO purposes).
I have a page that gives a logo and description of a brand e.g. Volvo. I want to use this same page as a template for all manufacturers but just change a few words around to customize it for each manufacturer accordingly. So in the URL I pass it a variable of the manufacturer e.g. "www.example.com/cars.cfm?manufacturer=BMW" and it will show a page that gives information about BMW.
The problem is that for each manufacturer the information is still showing up as the same page "cars.cfm" in the address bar but really I want it to go to a URL like "www.example.com/manufacturers/volvo.cfm" so it appears as a unique page just for that brand. But at the same time I don't want to have to create a seperate CFM (or php/asp) page for each manufacturer.
Is there a clever way to do this at all? I imagine its something to do with URL rewriting but not sure. I am using IIS 7.5.
Creating numerous sub-folders for different car manufacturers is going to be very tedious. My site would also include other types of manufacturers for different products not just cars. I guess URL rewriting would be best but my idea was to have a different 'page' for each manufacturer so the SEO would be improved.
Basically....
www.example.com/manufacturers/audi.cfm
www.example.com/manufacturers/bmw.cfm
www.example.com/manufactueres/volkswagen.cfm
But really I want the data on each of those pages to come from a database which contains unique data for each manufacturer such the logo image and history description.
Here is an example of what I mean:
http://www.fivestarautocentre.co.uk <-- go to bottom of that page and you can see links to various manufacturers
Building on what everyone else said, start by creating your www.example.com/cars.cfm?manufacturer=BMW page and get that working.
Assuming you're on IIS you would then create a web.config file (if it isn't already there) in your root folder.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Cars-Rewrite">
<match url="manufacturer/(\w+)" />
<action type="Rewrite" url="/cars.cfm?manufacturer={R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
My regex could be off, but maybe someone else could chime in with the correct regex.
You can certainly handle this with URL rewriting as others have suggested but I think I would take a different approach. Particularly for SEO purposes. The best solution for SEO will be an actual URL for each brand. With that in mind create your site accordingly. Don't use a generic www.example.com/cars.cfm page, use www.example.com/bmw, www.example.com/volvo, etc. You can still have a ColdFusion page under each of those folders that does nothing more than include your generic ColdFusion template from another location (or call a cfc). Since each folder will have it's own unique stub file you can pass the appropriate vehicle manufacturer when the generic ColdFusion template is called. For example, under the www.example.com/bmw page:
<cfset manufacturer = "bmw" />
<cfinclude template="/mytemplates/genericpage.cfm" />
Then your genericpage.cfm uses the assigned variable to display the appropriate text and graphics. You could even get around having to set a particular variable under each folder by parsing the URL and grabbing the manufacturer from it when the template is included and executed. I believe the cgi.script_name variable will contain the path needed to do this.
i want to do simple URL re-writing in Umbraco 5 like we used to do in previous versions i-e changing the UrlRewriting.config file, or we used to do it in Asp .Net
<rewriter>
<rewrite url="~/en/faq.aspx" to="~/faq.aspx" />
</rewrite>
I know we can create new area in the application and then add new routes in areaRegisteration.cs. but then the problem of mapping these controllers to the default Views arises, as the views are in: Views > Umbraco Directory of the application.
For example,
I create a new Area Named "En" and add Route in EngAreaRegisteration.cs, i-e
context.MapRoute("en_property","en/{city}/{controller}/{action}",new { } );
then how i can map the Actions to any Umbraco Page, i dont think the Redirect is a solution as redirect will change the Url,
my URL will be like this, en/paris/property/book
i am using Umbraco 5.0.1 Web deploy.
Thanks in Advance
Sher
i need to change all the sub-site default page url to my custom layout page url.
for ex: i have a one sub site call : http://test:1210/Site1/default.aspx. using coding i want to set this to : http://test:1210/Site1/_layouts/pages/test1.aspx.
is it possible in team site to change default page url using coding.
Team site default pages are default.aspx, so you have to do something like this:
http://attis.org/blogs/dan/archive/2008/10/29/how-to-change-the-default-page-of-a-sharepoint-site-using-a-feature.aspx
If you were using the publishing feature, you could set the welcome page
https://serverfault.com/questions/183943/change-sharepoint-team-site-home-page
Here is the easiest way to set the default page in a Team Site from code behind :
SPFolder rootFolder = Web.RootFolder; // root folder of the web object
rootFolder.WelcomePage = "SitePages/xyz.aspx"; // url of the page you want to set as default page
rootFolder.Update();
I have a publishing site, say http://dev. I've created a page called About.aspx, so the url would be http://dev/Pages/About.aspx. I'd like to use Feature so that the About.aspx page is available when users access it from the child sites, for example: [http]://dev/2010-01/Pages/About.aspx, [http]://dev/2010-02/Pages/About.aspx, and so on, without having to copy the About.aspx to each site.
Have these sites already been created? If not you could create your own site definition and add it using a module
<Module Name="AboutPage" Url="Pages" RootWebOnly="FALSE">
<File Url="About.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" />
</Module>