How to create a Editor editable sidebar in Umbraco? - umbraco

How can I create a sidebar in Umbraco that is common to all pages that uses a specific template, but is still editable for a editor?
If I simply create the sidebar in the template I would have to edit it myself every time they want something changes.
On the other hand if I create a sidebar field in the document type and map it to the sidebar in the template the editors have to recreate the same sidebar content for every page.

It's possible to use the recursive property on your template.
Basically what you do is on your homepage, or which ever root node for the section you want to use, you create the property which will contain your sidebar text. I would suggest the homepage.
Then you add a page field on the template with the attribute recursive=true
You can add the page field by adding the property a follows
This would result in a field that looks something like the following
<umbraco:Item field="category" recursive="true" runat="server" />
In my example, the property on the homepage which is being used is category.
Then any page which exists below the homepage, if it doesn't have a property with the same alias, then the value from the homepage will be taken.
A very useful feature :)

Related

Changing page asset definiton

I am on Oracle WebCenter Sites 11gR1.
I have an asset page that is on the tree of a site.
The page requirements and presentation have changed, so a new definition is needed to hold the references to other assets (the original definition can not be changed since is used in other pages). The page to change its definition is linked/referenced from other assets/URLs, so it is not possible to replace it with a new page.
Is it possible to change the page definition? How can this be achieved?
When i edit the page, the definition field is only a link to the definition, but not an editable field.
Thank you
You cannot change the page definition of an existing page instance.
You can change the existing page definition, that is being used in your page instances.
Go to Admin Perspective > Search > Page Definition > Search by your Page Definition > Click on Edit (pencil) and make your changes (eg: add or remove attributes).
If you want to add new page attributes, you should create the page attributes before edit the page definition.

Use a html page as a custom section in Umbraco 7 without a tree

I have a HTML page that I want to show in a custom section in Umbraco 7.
I want to do this without having any tree within that section, as everything is already handled within the html file - It is being placed into the Umbraco back end for convenient access.
So far I have implemented IApplication which gets the section to show as expected. I did have a tree with a single node (Inheriting from BaseTree, making this a legacy section), however, I want to make full use of the space available and just load in my html file and have no tree showing.
Removing the nodes from the BaseTree Render method hides the panel that shows the tree, but I can't figure out how to load in the Html file as the default view for that section.
Is there an easy way to do this by essentially setting a default page to load when the user clicks into the section?
You can set the default view for a custom section in Umbraco 7 by adding a new section element to Dashboard.config as follows:
<section alias="StartupCustomDashboardSection">
<areas>
<area>custom</area>
</areas>
<tab caption="Get Started">
<control>/app_plugins/custom/defaultview.html</control>
</tab>
</section>
where the <area> element must contain the alias of your custom section, all in lower case.
The <control> element contains the path of the default html file.

How to change URL names in Umbraco

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" />

Change CSS style using drop down menu in MVC

I'm trying to make a drop down menu that has a bunch of items (Amelia, Cerulean, Cosmo, Cyborg, Flatly, Journal). Each of these items represent a css file.
When one of them is selected I want my website to take this selected css file and apply it to the website.
I would like the drop down menu to interact with jquery, meaning when a item is selected jquery takes over and makes a asyn/ajax call to some mvc actionresult.
By the way I'm using MVC 5.
I hope someone can help me sketch the initial groundwork.
I've implemented this in my application.
I'm not sure what to tell you though. It's easier when we have an attempted solution to fix.
Here's an overview of how mine works:
I have created a controller called SharedController. The purpose of it is to contain various actions that render common actions. All of the actions are considered ChildActionOnly.
My _Layout uses RenderAction to render the action NavbarPartial which is in my SharedController.
More importantly the Navbar partial then uses RenderAction to render the action ThemeListPartial. This action is responsible for getting a list of available themes. The list of available themes is determined at applications startup. I've created a ThemeFinder class and ThemeRepository class that are responsible for finding and storing themes. The ThemeFinder finds themes by expressions that you give it. In a new class called App_Start/ThemeConfig I've given it only one expression - "~/Content/themes/{name}.bootstrap.css". This will find all themes with that naming convention in that location.
My razor code will take the ViewModel and display a dropdown menu in the navbar.
To get the themes to change my dropdown menu contains an AJAX link to an action called SaveTheme in ThemeController. This action takes a theme name as a string and tries to save it in a cookie for the user.
If the theme is found and saved successfully, the action responds with a success message.
jQuery then changes the theme by finding the associated link attribute and changing the HREF contents to the new theme. It knows the new theme relative URL because I have it stored in data attributes.
I completed this before I made the switch to AngularJs. The one thing I plan to go back and change is to cut out as much (maybe all) jQuery as possible and replace it with better code.

How to add translation for Category name in Prestashop?

I understand that when we add a new word in the template using smarty templates syntax like
{l s="Example"}
Will show up for translation in the admin control panel translation page but how can I add translations for Category names, which are added from the admin control panel and not in the template, template simply gets the categories from database.
You simply have to modify your categories, next to the name input field you will see flags, just click and modify corresponding translation.

Resources