Umbraco - editing preview window sidebar options - umbraco

I have a project which is using Umbraco v7.7.9 installed with nuget.
I was wondering if it is possible to change the buttons displayed in the sidebar section when a user selects to preview a content node. Particularly I want to remove the option that allows the user to close the preview.
The reason I want to hide this option is because some of the content the backoffice users will be previewing will not actually be published yet so clicking the close preview button causes an error.
I first asked this question on the Umbraco forums but haven't received a response yet, here is the link to the question: https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/90878-editing-preview-window-sidebar-options
Thank you in advance.

Currently no - it would not be possible without doing hacks in the Core that would be overwritten when you upgrade your site (unless you manually merge your changes in when updating).
If you however don't mind doing that - the file used for the preview function is /umbraco/preview/index.html. You should look for the element with an exitPreview() click handler attached to it.
In later versions (7.10+) this modification will have to be done in /umbraco/Views/Preview/Index.cshtml instead, as these static files will be changed to MVC actions.

Related

Add custom button for Jira issue

Is it possible to add button in jira issue without any add-on plugins?
I need one button in issue page, after click on button I should redirect to given button url along with some issue details as parameters.
If you goal to do it without any add-on - try use Announcement banner. You can include js script to banner and draw button from this script by any way easy to you. Announcement banner runs in every single Jira page. Therefore perhaps better to determine that user is on issue page through check url path or page content or whatever else before draw a button.
You can also use any of these addons:
JsIncluder (you can easily include custom JS per project or issue type) (FREE)
ScriptRunner (and its Web Fragments) (PAID)

How to create a link to directly edit a SharePoint list item

I have a SharePoint online 2016 site, with a List. Now i want to have a URL (build in MS Flow) that will point directly to a specific item in Edit mode.
Meaning to have this view (both list behind and right "popup" screen):
And not like this (Copy link url)
I am able to have it opened in full screen but not like the screenshot.
Can anyone tell me if this is even possible?
I have looked into these:
http://mmkhome.blogspot.com/2010/12/sharepoint-edit-page-url-querystring.html
http://blogbaris.blogspot.com/2012/09/open-sharepoint-2010-display-edit-new.html
https://social.msdn.microsoft.com/Forums/en-US/c27e2cdd-bddb-473c-9782-0309e026204f/to-show-a-editform-in-dialog-box?forum=sharepointcustomizationprevious
https://www.spcnl.nl/redirect-link-to-item-url-from-out-microsoft-flow-to-editform-instead-of-displayform/
and tried literally everything suggested in all these links but no luck.
Things like:
Web URL/Lists/List Name/AllItems.aspx?displaymode=design
Web URL/Lists/List Name/EditForm.aspx?ID={List item ID}
/DispForm.aspx?ID=...
/EditForm.aspx?ID=...
?ID=123&pagemode=edit
?ID=123&mode=edit
PageType=4
Any suggestion is greatly appreciated!
Devtools shows that after clicking on "Edit" button above list name (the way you open this extended edit menu from first screenshoot), a REST API call is fired:
https://tenant.sharepoint.com/sites/test_site/
_api/web/GetList(%27%2Fsites%2Ftest%5Fsite%2FLists%2Ftest%5Flist%27)
/RenderExtendedListFormData(itemId=4,formId='editform',mode='2',options=15,cutoffVersion=0)
And that's it - RenderExtendedListFormData method fetch data and later, I guess, JavaScript does the rest of magic and slides out the edit menu.
To sum up: I am afriad it will be not possible using only pure URL.

Umbraco says it's saved changes to templates but the changes are lost

Each time I make a change to an Umbraco template and press Save, I get the confirmation popup saying:
Template saved
Template saved without any errors!
However, when I return to that template (click on another template and then back again), the changes have been lost.
I've ensured that the user account running my IIS application pool has Full Control over the \Views folder containing the .cshtml files (i.e. the Umbraco templates).
Strangely this just started happening, after it had been letting me make template changes with no problems. I can manually edit the .cshtml files on disk, but this seems ridiculous.
Any ideas?
A couple of things:
1) Have you checked that the following Windows accounts have full permissions for all folders "IUSR", "IIS_IUSRS", "NETWORK SERVICE" ?
2) Probably not but I have had problems in the past with caching. Have you disabled (set from True to False) caching properties in /config/umbracoSettings.config ? This should always be done during development.
OK, I'll provide an answer for others' future reference (although the reasons are unclear to me). It appears the change I was making to my Template must've been deemed invalid by Umbraco - when I strip the template text down to just a single, empty div and save it, the change is persisted successfully.
The confusing thing is that Umbraco provides no feedback as to why it's not saving - in fact it tells you that it HAS saved successfully.
Bizarre and confusing.
Just been editing my templates and got this problem. Fixed it by doing the following:
sign out of umbraco
clear your browsing data
sign back into umbraco
always be sure to copy and paste your code somewhere to keep it safe, and it can be easily pasted back in. Seems like a bug to me... but it saved after I did that.
(Using Umbraco 7)

Display options.xul programmatically

I have an xul overlay based Firefox Add-on that works. It has inline options defined in content/options.xul and they display/function correctly when the user goes to Firefox->Add-ons->Extensions->{The Name of My Extension}->Options
The question, can I a create a button on my Add-on that will launch my options either by taking the user to Firefox->Add-ons->Extensions->{The Name of My Extension}->Options with one click or by launching a dialog based on options.xul?
Right now I am maintaining a separate options.html and options.js that gets and sets the same settings that options.xul handles when the user navigates there via the Firefox button but I would much rather dump options.html and options.js and only maintain my main.js and options.xul.
Any comments or code examples will be greatly appreciated.
This is easiest to do via a global function BrowserOpenAddonsMgr() defined in the browser window, like this:
BrowserOpenAddonsMgr("addons://detail/" + encodeURIComponent(addonID));
This function takes care of focusing the existing add-ons tab if there is one or opening a new tab. It will not scroll down to the options however which is an issue if the add-on has a lengthy description. Starting with Firefox 12 this can be solved by adding "/preferences" to the view identifier:
BrowserOpenAddonsMgr("addons://detail/" + encodeURIComponent(addonID) + "/preferences");
With older Firefox versions you are out of luck (and you shouldn't use this suffix there, it won't work). The other issue is that there can be a lengthy "loading" phase where the add-ons manager fetches metadata for all extensions.

ActiveX Control always working on my machine - unpredictable behavior on others?

I have a question about my ActiveX control not always working in IE on other machines.
Context: I'm working on an internal app for my company. It is designed to be a standalone web-page config tool for viewing a static customized version of our web app. The user may select the colors, images, and other settings they would like to see, and these will be present in the static mockup/preview version on their machine when they click a button.
Implementation: my javascript file creates a filesystem/activex object that essentially creates a temporary javascript file to which a list of values are written. Then when the user previews the configuration, the javascript file is located and values are loaded dynamically into the dom, etc etc. Naturally this functionality only works in Internet Explorer and is shady at best, but is my only way of implementing a purely zero configuration, client-side dynamic webapp.
Problem: When I test out my script, Internet Explorer prompts me twice about ActiveX controls and I say "yes" to them and the ActiveX functions work. I do this every single time I open my page. But sometimes when I send the file to another person so they can use it, they don't get the notifications so it doesn't work. However sometimes they do get notifications and it does work! I am using default security settings for IE so there should be no difference between my settings and theirs.
Could this be related to my user permissions vs theirs, or the fact that the files are read-only (because they are coming from source control and are also being made read-only when put on the shared drive.) or unknown dark Microsoft forces beyond human comprehension?
Thanks,
Josh
I believe you may want to create an HTA (HTML Application) instead of a web page. Writing HTA's gives you more privileges as far as ActiveX objects are concerned. Check out this page from Microsoft: http://msdn.microsoft.com/en-us/library/ms536496(v=vs.85).aspx.
To answer your question about privileges, I believe that some of your coworkers' IE settings probably prevent web pages from using ActiveX objects. Your settings may be such that you are prompted whenever ActiveX object are about to be created.

Resources