Skip to content

Instantly share code, notes, and snippets.

@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using System
@{
var siteRoot = CurrentPage.AncestorOrSelf(1);
string thePage = "";
var canonicalUrl= String.Empty;
var siteHost = Request.ServerVariables["HTTP_HOST"];
string sepChar = " — ";
@rbaty-barr
rbaty-barr / ExamineIndex.config
Last active February 15, 2017 12:18
this ezSearch takes into account a multi searcher... just a starting point
<?xml version="1.0"?>
<!--
Umbraco examine is an extensible indexer and search engine.
This configuration file can be extended to create your own index sets.
Index/Search providers can be defined in the UmbracoSettings.config
More information and documentation can be found on CodePlex: http://umbracoexamine.codeplex.com
-->
<ExamineLuceneIndexSets>
<IndexSet SetName="PDFIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/PDFs" />
@rbaty-barr
rbaty-barr / socialShareButtons.cshtml
Created February 21, 2017 15:30
Render social sharing buttons on a page.
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var pageID = ViewData["id"] != null ? ViewData["id"] : "1048";
var thePage = Umbraco.TypedContent(@pageID);
var theUrl = thePage.UrlAbsolute().ToString();
var theTitle = thePage.HasValue("socialShareTitle") ? thePage.GetPropertyValue("socialShareTitle") : "Important information from Segal Marco Advisors";
var theSummary = thePage.HasValue("socialShareDescription") ? thePage.GetPropertyValue("socialShareDescription") : "Need Default Summary";
var tweet = thePage.HasValue("twitterSocialShareDescription") ? thePage.GetPropertyValue("twitterSocialShareDescription") : theTitle;
var emailBody = theTitle + ": " + theSummary + " -- " + HttpUtility.UrlEncode(theUrl.ToString());
var emailSubject = "Information for you from Segal Marco Advisers";
@rbaty-barr
rbaty-barr / openGraphTags.cshtml
Created February 21, 2017 15:31
render some social sharing meta data to your page.
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
string domain = "http://" + HttpContext.Current.Request.Url.Host;
var canonicalUrl= String.Empty;
var theDescr = Model.Content.HasValue("socialShareDescription") ? Model.Content.GetPropertyValue<string>("socialShareDescription") : Model.Content.GetPropertyValue<string>("metaDescription");
var theTitle = Model.Content.HasValue("socialShareTitle") ? Model.Content.GetPropertyValue<string>("socialShareTitle") : Model.Content.GetPropertyValue<string>("pageHeadging");
var twitterDesc = Model.Content.HasValue("twitterSocialShareDescription") ? Model.Content.GetPropertyValue<string>("twitterSocialShareDescription") : theDescr;
var ultimateDefault = Model.Content.HasValue("defaultSocialMediaShareImage", true) ? Model.Content.GetPropertyValue<string>("defaultSocialMediaShareImage", true) : "1155";
var pubImageDefault = Model.Content.HasValue("publicationDefaultSocialMediaImage", true) ? Model.Content.GetPropertyValue<string>("publicationDefaultSocialMed
@rbaty-barr
rbaty-barr / wantTo.cshtml
Last active February 27, 2017 14:38
I want to dropdown
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using RJP.MultiUrlPicker.Models;
@{
var multiUrlPicker = Model.Content.GetPropertyValue<MultiUrls>("wantToItems");
if (multiUrlPicker.Any())
{
<div class="row">
<div class="col-sm-4">
<p class="wantToHeader">I want to...</p>
</div>
@rbaty-barr
rbaty-barr / 3dbtn.css
Created March 9, 2017 14:26
3d Button treatment for Bootstrap
.btn3d {
position:relative;
top: -6px;
border:0;
transition: all 40ms linear;
margin-top:10px;
margin-bottom:10px;
margin-left:2px;
margin-right:2px;
text-transform: uppercase;
@rbaty-barr
rbaty-barr / formsDocsHome.cshtml
Created March 19, 2017 18:42
Forms and Documents rendering
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
<div id="formsDocsArea">
@if(@Model.Content.HasValue("docsFolder") && @Model.Content.GetPropertyValue<string>("asHideShow") == "True"){
var mediaRoot = @Model.Content.GetPropertyValue("docsFolder");
<!-- comment -->
foreach( var item in Umbraco.TypedMedia(mediaRoot).Children){
if(@item.ContentType.Alias =="Folder" && Umbraco.TypedMedia(@item.Id).Children.Count() > 0){
@listFolders("hs", @item, Umbraco.TypedMedia(@item.Id).Children.Count().ToString())
@rbaty-barr
rbaty-barr / relatedDocs.cshtml
Created March 19, 2017 19:16
simple list of related documents using rjpMultiUrlPicker - umbraco add-on
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using RJP.MultiUrlPicker.Models
@{
var multiUrlPicker = Model.Content.GetPropertyValue<MultiUrls>("relatedItems");
if (multiUrlPicker.Any())
{
<div id="relatedDocs">
<h3>Related Documents & Links</h3>
<ul class="list-unstyled">
@rbaty-barr
rbaty-barr / custom.css
Last active April 12, 2017 16:52
base css file with media queries and some base platform idents in place
/* custom styles here */
.android {
display: none;
}
.windows {
display: none;
}
.ios {
@rbaty-barr
rbaty-barr / resetAdmin.txt
Last active April 21, 2017 17:38
If you get stuck type resources and references
The situation is this... you can no longer get into the umbraco backoffice for one reason or another... trust me it happens!
So, there is a package you can download and it works in most cases:
https://our.umbraco.org/projects/developer-tools/umbraco-admin-reset/
With this package you simply upload the dll to the server via ftp and place it in the .bin folder and you can login in with Admin and Admin1234!
===================================================
however, if you are doing local dev with a compact SQL DB you will have to open the db in web matrix or similar then you can use this command:
UPDATE umbracoUser set userdisabled=0, userLogin='admin', userPassword='bnWxWyFdCueCcKrqniYK9iAS+7E=' where id=0